home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MPW 411 / CIncludesHelp < prev    next >
Encoding:
Text File  |  1990-07-19  |  2.8 MB  |  89,910 lines  |  [TEXT/MPS ]

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1. æKY CopyrightNotice
  2. æC  Copyright Apple Computer, Inc. 1985-1990, All rights reserved.
  3. 411 - CIncludes Help - QR 1 Release.
  4. Friday, July 6, 1990 1:22:42 PM
  5.  
  6. æKY Help
  7. CIncludesHelp
  8. æKL AboutCIncludesHelp.h
  9. ADSP.h
  10. Aliases.h
  11. AppleEvents.h
  12. Appletalk.h
  13. Balloons.h
  14. Controls.h
  15. CursorCtl.h
  16. DatabaseAccess.h
  17. DDEV.h
  18. Desk.h
  19. Deskbus.h
  20. Devices.h
  21. Dialogs.h
  22. DisAsmLookup.h
  23. DiskInit.h
  24. Disks.h
  25. Editions.h
  26. EPPC.h
  27. ErrMgr.h
  28. Errors.h
  29. Events.h
  30. Files.h
  31. FixMath.h
  32. Folders.h
  33. Fonts.h
  34. Globals
  35. Graf3D.h
  36. HyperXCmd.h
  37. Lists.h
  38. Math.h
  39. Memory.h
  40. Menus.h
  41. Notification.h
  42. OSEvents.h
  43. OSUtils.h
  44. Packages.h
  45. Palettes.h
  46. Perf.h
  47. Picker.h
  48. Power.h
  49. PPCToolBox.h
  50. PrintTraps.h
  51. Processes.h
  52. QDOffscreen.h
  53. Quickdraw.h
  54. Resources.h
  55. Retrace.h
  56. ROMDefs.h
  57. SANE.h
  58. Scrap.h
  59. Script.h
  60. SCSI.h
  61. Segload.h
  62. Serial.h
  63. ShutDown.h
  64. Slots.h
  65. Sound.h
  66. StandardFile.h
  67. Start.h
  68. Strings.h
  69. SysEqu.h
  70. TextEdit.h
  71. Timer.h
  72. ToolUtils.h
  73. Types.h
  74. Video.h
  75. Windows.h
  76.  
  77. StdCLib
  78.  
  79. Assert.h
  80. Ctype.h
  81. Errno.h
  82. FCntl.h
  83. Float.h
  84. IOCtl.h
  85. Limits.h
  86. Locale.h
  87. Math.h
  88. SetJmp.h
  89. Signal.h
  90. StdArg.h
  91. StdDef.h
  92. StdIO.h
  93. StdLib.h
  94. String.h
  95. Time.h
  96.  
  97. æKY AboutCincludesHelp.h
  98. æC
  99.  
  100. Version 1.0 Beta:
  101.  
  102. This version contains the InsideMacintosh Volume VI information.
  103.  
  104. æKY ADSP.h
  105. æKL 
  106. attnBufSize
  107. dspAttention
  108. dspCLDeny
  109. dspCLInit
  110. dspCLListen
  111. dspClose
  112. dspCLRemove
  113. dspInit
  114. dspNewCID
  115. dspOpen
  116. dspOptions
  117. DSPParamBlock
  118. DSPPBPtr
  119. dspRead
  120. dspRemove
  121. dspReset
  122. dspStatus
  123. dspWrite
  124. eAttention
  125. eClosed
  126. eFwdReset
  127. errAborted
  128. errAttention
  129. errFwdReset
  130. errOpening
  131. errRefNum
  132. errState
  133. eTearDown
  134. ocAccept
  135. ocEstablish
  136. ocPassive
  137. ocRequest
  138. sClosed
  139. sClosing
  140. sListening
  141. sOpen
  142. sOpening
  143. sPassive
  144. TPCCB
  145. TRattnParams
  146. TRCCB
  147. TRcloseParams
  148. TRinitParams
  149. TRioParams
  150. TRnewcidParams
  151. TRopenParams
  152. TRoptionParams
  153. TRstatusParams
  154.  
  155. æKY errRefNum
  156. æFc ADSP.h
  157. æT #define
  158. æD 
  159. /*         constants                                                     
  160.  
  161.  result codes */
  162.  
  163. #define errRefNum -1280 /* bad connection refNum */
  164. æC 
  165.  
  166. æKY errAborted
  167. æFc ADSP.h
  168. æT #define
  169. æD #define errAborted -1279 /* control call was aborted */
  170. æC 
  171.  
  172. æKY errState
  173. æFc ADSP.h
  174. æT #define
  175. æD #define errState -1278 /* bad connection state for this operation */
  176. æC 
  177.  
  178. æKY errOpening
  179. æFc ADSP.h
  180. æT #define
  181. æD #define errOpening -1277 /* open connection request was denied */
  182. æC 
  183.  
  184. æKY errAttention
  185. æFc ADSP.h
  186. æT #define
  187. æD #define errAttention -1276 /* attention message too long */
  188. æC 
  189.  
  190. æKY errFwdReset
  191. æFc ADSP.h
  192. æT #define
  193. æD #define errFwdReset -1275 /* read terminated by forward reset */
  194. æC 
  195.  
  196. æKY dspInit
  197. æFc ADSP.h
  198. æT #define
  199. æD 
  200. /*  control codes */
  201.  
  202. #define dspInit 255 /* create a new connection end */
  203. æC 
  204.  
  205. æKY dspRemove
  206. æFc ADSP.h
  207. æT #define
  208. æD #define dspRemove 254 /* remove a connection end */
  209. æC 
  210.  
  211. æKY dspOpen
  212. æFc ADSP.h
  213. æT #define
  214. æD #define dspOpen 253 /* open a connection */
  215. æC 
  216.  
  217. æKY dspClose
  218. æFc ADSP.h
  219. æT #define
  220. æD #define dspClose 252 /* close a connection */
  221. æC 
  222.  
  223. æKY dspCLInit
  224. æFc ADSP.h
  225. æT #define
  226. æD #define dspCLInit 251 /* create a connection listener */
  227. æC 
  228.  
  229. æKY dspCLRemove
  230. æFc ADSP.h
  231. æT #define
  232. æD #define dspCLRemove 250 /* remove a connection listener */
  233. æC 
  234.  
  235. æKY dspCLListen
  236. æFc ADSP.h
  237. æT #define
  238. æD #define dspCLListen 249 /* post a listener request */
  239. æC 
  240.  
  241. æKY dspCLDeny
  242. æFc ADSP.h
  243. æT #define
  244. æD #define dspCLDeny 248 /* deny an open connection request */
  245. æC 
  246.  
  247. æKY dspStatus
  248. æFc ADSP.h
  249. æT #define
  250. æD #define dspStatus 247 /* get status of connection end */
  251. æC 
  252.  
  253. æKY dspRead
  254. æFc ADSP.h
  255. æT #define
  256. æD #define dspRead 246 /* read data from the connection */
  257. æC 
  258.  
  259. æKY dspWrite
  260. æFc ADSP.h
  261. æT #define
  262. æD #define dspWrite 245 /* write data on the connection */
  263. æC 
  264.  
  265. æKY dspAttention
  266. æFc ADSP.h
  267. æT #define
  268. æD #define dspAttention 244 /* send an attention message */
  269. æC 
  270.  
  271. æKY dspOptions
  272. æFc ADSP.h
  273. æT #define
  274. æD #define dspOptions 243 /* set connection end options */
  275. æC 
  276.  
  277. æKY dspReset
  278. æFc ADSP.h
  279. æT #define
  280. æD #define dspReset 242 /* forward reset the connection */
  281. æC 
  282.  
  283. æKY dspNewCID
  284. æFc ADSP.h
  285. æT #define
  286. æD #define dspNewCID 241 /* generate a cid for a connection end */
  287. æC 
  288.  
  289. æKY ocRequest
  290. æFc ADSP.h
  291. æT #define
  292. æD 
  293. /*  connection opening modes */
  294.  
  295. #define ocRequest 1 /* request a connection with remote */
  296. æC 
  297.  
  298. æKY ocPassive
  299. æFc ADSP.h
  300. æT #define
  301. æD #define ocPassive 2 /* wait for a connection request from remote */
  302. æC 
  303.  
  304. æKY ocAccept
  305. æFc ADSP.h
  306. æT #define
  307. æD #define ocAccept 3 /* accept request as delivered by listener */
  308. æC 
  309.  
  310. æKY ocEstablish
  311. æFc ADSP.h
  312. æT #define
  313. æD #define ocEstablish 4 /* consider connection to be open */
  314. æC 
  315.  
  316. æKY sListening
  317. æFc ADSP.h
  318. æT #define
  319. æD 
  320. /*  connection end states */
  321.  
  322. #define sListening 1 /* for connection listeners */
  323. æC 
  324.  
  325. æKY sPassive
  326. æFc ADSP.h
  327. æT #define
  328. æD #define sPassive 2 /* waiting for a connection request from remote */
  329. æC 
  330.  
  331. æKY sOpening
  332. æFc ADSP.h
  333. æT #define
  334. æD #define sOpening 3 /* requesting a connection with remote */
  335. æC 
  336.  
  337. æKY sOpen
  338. æFc ADSP.h
  339. æT #define
  340. æD #define sOpen 4 /* connection is open */
  341. æC 
  342.  
  343. æKY sClosing
  344. æFc ADSP.h
  345. æT #define
  346. æD #define sClosing 5 /* connection is being torn down */
  347. æC 
  348.  
  349. æKY sClosed
  350. æFc ADSP.h
  351. æT #define
  352. æD #define sClosed 6 /* connection end state is closed */
  353. æC 
  354.  
  355. æKY eClosed
  356. æFc ADSP.h
  357. æT #define
  358. æD 
  359. /*  client event flags */
  360.  
  361. #define eClosed 0x80 /* received connection closed advice */
  362. æC 
  363.  
  364. æKY eTearDown
  365. æFc ADSP.h
  366. æT #define
  367. æD #define eTearDown 0x40 /* connection closed due to broken connection */
  368. æC 
  369.  
  370. æKY eAttention
  371. æFc ADSP.h
  372. æT #define
  373. æD #define eAttention 0x20 /* received attention message */
  374. æC 
  375.  
  376. æKY eFwdReset
  377. æFc ADSP.h
  378. æT #define
  379. æD #define eFwdReset 0x10 /* received forward reset advice */
  380. æC 
  381.  
  382. æKY attnBufSize
  383. æFc ADSP.h
  384. æT #define
  385. æD 
  386. /*  miscellaneous constants */
  387.  
  388. #define attnBufSize 570 /* size of client attention buffer */
  389. æC 
  390.  
  391. æKY TRCCB
  392. TPCCB
  393. æFc ADSP.h
  394. æT struct
  395. æD struct TRCCB {
  396.     unsigned char *ccbLink; /* link to next ccb */
  397.     unsigned short refNum; /* user reference number */
  398.     unsigned short state; /* state of the connection end */
  399.     unsigned char userFlags; /* flags for unsolicited connection events */
  400.     unsigned char localSocket; /* socket number of this connection end */
  401.     AddrBlock remoteAddress; /* internet address of remote end */
  402.     unsigned short attnCode; /* attention code received */
  403.     unsigned short attnSize; /* size of received attention data */
  404.     unsigned char *attnPtr; /* ptr to received attention data */
  405.     unsigned char reserved[220]; /* for adsp internal use */
  406. };
  407.  
  408. typedef struct TRCCB TRCCB;
  409. typedef TRCCB *TPCCB;
  410.  
  411. æC 
  412.  
  413. æKY TRinitParams
  414. æFc ADSP.h
  415. æT struct
  416. æD struct TRinitParams {
  417.     TPCCB ccbPtr; /* pointer to connection control block */
  418.     ProcPtr userRoutine; /* client routine to call on event */
  419.     unsigned short sendQSize; /* size of send queue (0..64K bytes) */
  420.     unsigned char *sendQueue; /* client passed send queue buffer */
  421.     unsigned short recvQSize; /* size of receive queue (0..64K bytes) */
  422.     unsigned char *recvQueue; /* client passed receive queue buffer */
  423.     unsigned char *attnPtr; /* client passed receive attention buffer */
  424.     unsigned char localSocket; /* local socket number */
  425. };
  426.  
  427. typedef struct TRinitParams TRinitParams;
  428. /*  init connection end parameters  */
  429. æC 
  430.  
  431. æKY TRopenParams
  432. æFc ADSP.h
  433. æT struct
  434. æD struct TRopenParams {
  435.     unsigned short localCID; /* local connection id */
  436.     unsigned short remoteCID; /* remote connection id */
  437.     AddrBlock remoteAddress; /* address of remote end */
  438.     AddrBlock filterAddress; /* address filter */
  439.     unsigned long sendSeq; /* local send sequence number */
  440.     unsigned short sendWindow; /* send window size */
  441.     unsigned long recvSeq; /* receive sequence number */
  442.     unsigned long attnSendSeq; /* attention send sequence number */
  443.     unsigned long attnRecvSeq; /* attention receive sequence number */
  444.     unsigned char ocMode; /* open connection mode */
  445.     unsigned char ocInterval; /* open connection request retry interval */
  446.     unsigned char ocMaximum; /* open connection request retry maximum */
  447. };
  448.  
  449. typedef struct TRopenParams TRopenParams;
  450. /*  open connection parameters  */
  451. æC 
  452.  
  453. æKY TRcloseParams
  454. æFc ADSP.h
  455. æT struct
  456. æD struct TRcloseParams {
  457.     unsigned char abort; /* abort connection immediately if non-zero */
  458. };
  459.  
  460. typedef struct TRcloseParams TRcloseParams;
  461. /*  close connection parameters  */
  462. æC 
  463.  
  464. æKY TRstatusParams
  465. æFc ADSP.h
  466. æT struct
  467. æD struct TRstatusParams {
  468.     TPCCB ccbPtr; /* pointer to ccb */
  469.     unsigned short sendQPending; /* pending bytes in send queue */
  470.     unsigned short sendQFree; /* available buffer space in send queue*/
  471.     unsigned short recvQPending; /* pending bytes in receive queue */
  472.     unsigned short recvQFree; /* available buffer space in receive queue */
  473. };
  474.  
  475. typedef struct TRstatusParams TRstatusParams;
  476. /*  client status parameter block  */
  477. æC 
  478.  
  479. æKY TRioParams
  480. æFc ADSP.h
  481. æT struct
  482. æD struct TRioParams {
  483.     unsigned short reqCount; /* requested number of bytes */
  484.     unsigned short actCount; /* actual number of bytes */
  485.     unsigned char *dataPtr; /* pointer to data buffer */
  486.     unsigned char eom; /* indicates logical end of message */
  487.     unsigned char flush; /* send data now */
  488. };
  489.  
  490. typedef struct TRioParams TRioParams;
  491. /*  read/write parameter block  */
  492. æC 
  493.  
  494. æKY TRattnParams
  495. æFc ADSP.h
  496. æT struct
  497. æD struct TRattnParams {
  498.     unsigned short attnCount; /* client attention code */
  499.     unsigned short attnSize; /* size of attention data */
  500.     unsigned char *attnData; /* pointer to attention data */
  501.     unsigned char attnInterval; /* retransmit timer in 10-tick intervals */
  502. };
  503.  
  504. typedef struct TRattnParams TRattnParams;
  505. /*  attention parameter block  */
  506. æC 
  507.  
  508. æKY TRoptionParams
  509. æFc ADSP.h
  510. æT struct
  511. æD struct TRoptionParams {
  512.     unsigned short sendBlocking; /* quantum for data packets */
  513.     unsigned char sendTimer; /* send timer in 10-tick intervals */
  514.     unsigned char rtmtTimer; /* retransmit timer in 10-tick intervals */
  515.     unsigned char badSeqMax; /* threshold for sending retransmit advice */
  516.     unsigned char useCheckSum; /* use ddp packet checksum */
  517. };
  518.  
  519. typedef struct TRoptionParams TRoptionParams;
  520. /*  client send option parameter block  */
  521. æC 
  522.  
  523. æKY TRnewcidParams
  524. æFc ADSP.h
  525. æT struct
  526. æD struct TRnewcidParams {
  527.     unsigned short newcid; /* new connection id returned */
  528. };
  529.  
  530. typedef struct TRnewcidParams TRnewcidParams;
  531. /*  new cid parameters  */
  532. æC 
  533.  
  534. æKY DSPParamBlock
  535. DSPPBPtr
  536. æFc ADSP.h
  537. æT struct
  538. æD union DSPParamBlock {
  539.     QElem *qLink;
  540.     short qType;
  541.     short ioTrap;
  542.     Ptr ioCmdAddr;
  543.     ProcPtr ioCompletion;
  544.     OSErr ioResult;
  545.     char *ioNamePtr;
  546.     short ioVRefNum;
  547.     short ioCRefNum; /* adsp driver refnum */
  548.     short csCode; /* adsp driver control code */
  549.     long qStatus; /* adsp internal use */
  550.     short ccbRefNum; /* connection end reNum*/
  551.     union ;
  552.     {
  553.     TRinitParams initParams; /* dspInit, dspCLInit */
  554.     TRopenParams openParams; /* dspOpen, dspCLListen, dspCLDeny */
  555.     TRcloseParams closeParams; /* dspClose, dspRemove */
  556.     TRioParams ioParams; /* dspRead, dspWrite */
  557.     TRattnParams attnParams; /* dspAttention */
  558.     TRstatusParams statusParams; /* dspStatus */
  559.     TRoptionParams optionParams; /* dspOptions */
  560.     TRnewcidParams newCIDParams; /* dspNewCID */
  561. };
  562.  
  563. typedef union DSPParamBlock DSPParamBlock;
  564.  
  565. typedef DSPParamBlock *DSPPBPtr;
  566.  
  567. /*  ADSP CntrlParam ioQElement  */
  568. æC 
  569.  
  570.  
  571. æKY Aliases.h
  572. æKL CanonifyFile
  573. GetAliasInfo
  574. MatchAlias
  575. NewAlias
  576. NewAliasMinimal
  577. NewAliasMinimalFromFullpath
  578. ResolveAlias
  579. SelectAlias
  580. UpdateAlias
  581.  
  582. AliasFilterProcPtr
  583. AliasHandle
  584. AliasInfoType
  585. AliasPtr
  586. AliasRecord
  587. asiAliasName
  588. asiParentName
  589. asiServerName
  590. asiVolumeName
  591. asiZoneName
  592. CanonicalFileSpec
  593. CanonicalFileSpecList
  594. kARMmountVol
  595. kARMmultVols
  596. kARMnoUI
  597. kARMsearch
  598. kARMsearchMore
  599. kARMsearchRelFirst
  600. ModalFilterWithCallback
  601. rAliasType
  602.  
  603. æKY rAliasType
  604. æFc Aliases.h
  605. æT #define
  606. æD 
  607. /* 
  608.     Constants 
  609.  */
  610.  
  611. #define rAliasType 'alis' /* Aliases are stored as resources of this type */
  612. æC 
  613.  
  614. æKY kARMmountVol
  615. æFc Aliases.h
  616. æT #define
  617. æD 
  618. /*  define alias resolution action rules mask */
  619.  
  620. #define kARMmountVol 0x00000001 /* mount the volume automatically */
  621. æC 
  622.  
  623. æKY kARMnoUI
  624. æFc Aliases.h
  625. æT #define
  626. æD #define kARMnoUI 0x00000002 /* no user interface allowed during resolution */
  627. æC 
  628.  
  629. æKY kARMmultVols
  630. æFc Aliases.h
  631. æT #define
  632. æD #define kARMmultVols 0x00000008 /* search on multiple volumes */
  633. æC 
  634.  
  635. æKY kARMsearch
  636. æFc Aliases.h
  637. æT #define
  638. æD #define kARMsearch 0x00000100 /* search quickly */
  639. æC 
  640.  
  641. æKY kARMsearchMore
  642. æFc Aliases.h
  643. æT #define
  644. æD #define kARMsearchMore 0x00000200 /* search further */
  645. æC 
  646.  
  647. æKY kARMsearchRelFirst
  648. æFc Aliases.h
  649. æT #define
  650. æD #define kARMsearchRelFirst 0x00000400 /* search target on a relative path first */
  651. æC 
  652.  
  653. æKY asiZoneName
  654. æFc Aliases.h
  655. æT #define
  656. æD 
  657. /*  define alias record information types */
  658.  
  659. #define asiZoneName -3 /* get zone name */
  660. æC 
  661.  
  662. æKY asiServerName
  663. æFc Aliases.h
  664. æT #define
  665. æD #define asiServerName -2 /* get server name */
  666. æC 
  667.  
  668. æKY asiVolumeName
  669. æFc Aliases.h
  670. æT #define
  671. æD #define asiVolumeName -1 /* get volume name */
  672. æC 
  673.  
  674. æKY asiAliasName
  675. æFc Aliases.h
  676. æT #define
  677. æD #define asiAliasName 0 /* get aliased file/folder/volume name */
  678. æC 
  679.  
  680. æKY asiParentName
  681. æFc Aliases.h
  682. æT #define
  683. æD #define asiParentName 1 /* get parent folder name */
  684. æC 
  685.  
  686. æKY AliasInfoType
  687. æFc Aliases.h
  688. æT typedef
  689. æD typedef short AliasInfoType; /* alias record information type */
  690. æC 
  691.  
  692. æKY AliasFilterProcPtr
  693. æFc Aliases.h
  694. æT typedef
  695. æD typedef pascal Boolean (*AliasFilterProcPtr) (CInfoPBPtr cpbPtr, /*I*/
  696.  Boolean *quitFlag, /*O*/
  697.  Ptr yourDataPtr); /*I*/
  698. æC 
  699.  
  700. æKY ModalFilterWithCallback
  701. æFc Aliases.h
  702. æT typedef
  703. æD typedef pascal Boolean (*ModalFilterWithCallback) (DialogPtr theDialog, /*I*/
  704.  EventRecord *theEvent, /*I*/
  705.   short *itemHit, /*O*/
  706.   Ptr yourDataPtr); /*I*/
  707. æC 
  708.  
  709. æKY CanonicalFileSpec
  710. CanonicalFileSpecList
  711. æFc Aliases.h
  712. æT struct
  713. æD struct CanonicalFileSpec {
  714.     Short vRefNum; /* volume reference number */
  715.     long dirID; /* directory ID */
  716.     Str63 fileName; /* file name */
  717. };
  718.  
  719. typedef struct CanonicalFileSpec CanonicalFileSpec;
  720. typedef CanonicalFileSpec *CanonicalFileSpecList;
  721.  
  722. æC 
  723.  
  724. æKY AliasRecord
  725. AliasPtr
  726. AliasHandle
  727. æFc Aliases.h
  728. æT struct
  729. æD struct AliasRecord {
  730.     OSType userType; /* appl stored type like creator type */
  731.     unsigned short aliasSize; /* alias record size in bytes, for appl usage*/
  732. };
  733.  
  734. typedef struct AliasRecord AliasRecord;
  735. typedef AliasRecord *AliasPtr, **AliasHandle;
  736.  
  737. /*  define the alias record that will be the blackbox for the caller  */
  738. æC 
  739.  
  740. æKY CanonifyFile
  741. æFc Aliases.h
  742. æT Function
  743. æTN A823
  744. æD pascal OSErr CanonifyFile(short vRefNum,long dirID,const Str255 fileName,
  745.     CanonicalFileSpec *canonicalFile)
  746.     = {0x7001,0xA823}; 
  747. æDT OSErr myVariable = CanonifyFile((short) vRefNum,(long) dirID,(const Str255) fileName,(
  748.     CanonicalFileSpec) * canonicalFile);
  749. æC 
  750.  
  751. æKY NewAlias
  752. æFc Aliases.h
  753. æT Function
  754. æTN A823
  755. æD pascal OSErr NewAlias(const CanonicalFileSpec *fromFile,const CanonicalFileSpec *target,
  756.     AliasHandle *alias)
  757.     = {0x7002,0xA823}; 
  758. æDT OSErr myVariable = NewAlias((const CanonicalFileSpec *) fromFile,(const CanonicalFileSpec *) target,(
  759.     AliasHandle) * alias);
  760. æC 
  761.  
  762. æKY NewAliasMinimal
  763. æFc Aliases.h
  764. æT Function
  765. æTN A823
  766. æD pascal OSErr NewAliasMinimal(const CanonicalFileSpec *target,AliasHandle *alias)
  767.     = {0x7008,0xA823}; 
  768. æDT OSErr myVariable = NewAliasMinimal((const CanonicalFileSpec *) target,(AliasHandle *) alias);
  769. æC 
  770.  
  771. æKY NewAliasMinimalFromFullpath
  772. æFc Aliases.h
  773. æT Function
  774. æTN A823
  775. æD pascal OSErr NewAliasMinimalFromFullpath(short fullpathLength,const unsigned char *fullpath,
  776.     const Str31 zoneName,const Str31 serverName,AliasHandle *alias)
  777.     = {0x7009,0xA823}; 
  778. æDT OSErr myVariable = NewAliasMinimalFromFullpath((short) fullpathLength,(const unsigned char *) fullpath,(
  779.     const) Str31 zoneName,(const Str31) serverName,(AliasHandle *) alias);
  780. æC 
  781.  
  782. æKY ResolveAlias
  783. æFc Aliases.h
  784. æT Function
  785. æTN A823
  786. æD pascal OSErr ResolveAlias(const CanonicalFileSpec *fromFile,AliasHandle alias,
  787.     CanonicalFileSpec *target,Boolean *wasChanged)
  788.     = {0x7003,0xA823}; 
  789. æDT OSErr myVariable = ResolveAlias((const CanonicalFileSpec *) fromFile,(AliasHandle) alias,(
  790.     CanonicalFileSpec) * target,(Boolean *) wasChanged);
  791. æC 
  792.  
  793. æKY SelectAlias
  794. æFc Aliases.h
  795. æT Function
  796. æTN A823
  797. æD pascal OSErr SelectAlias(const CanonicalFileSpec *fromFile,const Str31 fileTypeName,
  798.     Boolean aliasFilter,AliasHandle alias,CanonicalFileSpec *target,Boolean *wasChanged,
  799.     Boolean filterProc,Ptr yourDataPtr)
  800.     = {0x7004,0xA823}; 
  801. æDT OSErr myVariable = SelectAlias((const CanonicalFileSpec *) fromFile,(const Str31) fileTypeName,()
  802.     Boolean aliasFilter,(AliasHandle) alias,(CanonicalFileSpec *) target,(Boolean *) wasChanged,()
  803.     Boolean filterProc,(Ptr) yourDataPtr);
  804. æC 
  805.  
  806. æKY GetAliasInfo
  807. æFc Aliases.h
  808. æT Function
  809. æTN A823
  810. æD pascal OSErr GetAliasInfo(const AliasHandle alias,AliasInfoType index,const Str63 theString)
  811.     = {0x7007,0xA823}; 
  812. æDT OSErr myVariable = GetAliasInfo((const AliasHandle) alias,(AliasInfoType) index,(const Str63) theString);
  813. æC 
  814.  
  815. æKY MatchAlias
  816. æFc Aliases.h
  817. æT Function
  818. æTN A823
  819. æD pascal OSErr MatchAlias(const CanonicalFileSpec *fromFile,unsigned long rulesMask,
  820.     const AliasHandle alias,Short *aliasCount,const CanonicalFileSpecList *aliasList,
  821.     Boolean *needsUpdate,Boolean aliasFilter,Ptr yourDataPtr)
  822.     = {0x7005,0xA823}; 
  823. æDT OSErr myVariable = MatchAlias((const CanonicalFileSpec *) fromFile,(unsigned long) rulesMask,(
  824.     const) AliasHandle alias,(Short *) aliasCount,(const CanonicalFileSpecList *) aliasList,(
  825.     Boolean) * needsUpdate,(Boolean) aliasFilter,(Ptr) yourDataPtr);
  826. æC 
  827.  
  828. æKY UpdateAlias
  829. æFc Aliases.h
  830. æT Function
  831. æTN A823
  832. æD pascal OSErr UpdateAlias(const CanonicalFileSpec *fromFile,const CanonicalFileSpec *target,
  833.     AliasHandle alias,Boolean *wasChanged)
  834.     = {0x7006,0xA823}; 
  835. æDT OSErr myVariable = UpdateAlias((const CanonicalFileSpec *) fromFile,(const CanonicalFileSpec *) target,()
  836.     AliasHandle alias,(Boolean *) wasChanged);
  837. æC 
  838.  
  839.  
  840. æKY AppleEvents.h
  841. æKL AEAddEvtToTable
  842. AECoerceDesc
  843. AECountListElems
  844. AECreateAevt
  845. AECreateDispatchTable
  846. AECreateList
  847. AEDeleteIndex
  848. AEDeleteKey
  849. AEDisposeAEDesc
  850. AEDisposeAEList
  851. AEGetAddress
  852. AEGetArray
  853. AEGetDispatchTableRsrc
  854. AEGetEventClassAndID
  855. AEGetInteractLevel
  856. AEGetKeyDesc
  857. AEGetKeyPtr
  858. AEGetNthDesc
  859. AEGetNthPtr
  860. AEGetRefCon
  861. AEGetTableEntry
  862. AEInit
  863. AEInteractionAllowed
  864. AEInteractWithUser
  865. AEProcessAppleEvent
  866. AEPutArray
  867. AEPutDesc
  868. AEPutKeyDesc
  869. AEPutKeyPtr
  870. AEPutPtr
  871. AEQuit
  872. AEResetTimer
  873. AESend
  874. AESetAddressByPSN
  875. AESetAddressBySessionID
  876. AESetAddressBySignature
  877. AESetAddressByTargetID
  878. AEWhichAevt
  879.  
  880. AEAddress
  881. AEAddressHndl
  882. AEAddressPtr
  883. AEArrayType
  884. AEDesc
  885. AEInteractAllowed
  886. AEKeyDesc
  887. AEList
  888. DescType
  889. EventClass
  890. EventID
  891. kAEAliasType
  892. kAEAlwaysInteract
  893. kAEBadListElement
  894. kAEBooleanType
  895. kAECanInteract
  896. kAECanSwitchLayer
  897. kAECoercionFail
  898. kAECorruptData
  899. kAEDataArray
  900. kAEDescArray
  901. kAEDescNotFound
  902. kAEDirectObjectKeyword
  903. kAEDontReconnect
  904. kAEEventNotFound
  905. kAEEventNotInTable
  906. kAEFalseType
  907. kAEHandleArray
  908. kAEHighPriority
  909. kAEInteractionWithSelf
  910. kAEInteractWithAll
  911. kAEInteractWithLocal
  912. kAEKeyDescArray
  913. kAEListType
  914. kAELongType
  915. kAENeverInteract
  916. kAENoReply
  917. kAENormalPriority
  918. kAENotAEList
  919. kAENotAppleEvent
  920. kAENoUserInteraction
  921. kAEOpenApplication
  922. kAEOpenDocuments
  923. kAEPackedArray
  924. kAEPrintDocuments
  925. kAEQueueReply
  926. kAEQuitApplication
  927. kAEReplyNotValid
  928. kAETimeoutErr
  929. kAETrueType
  930. kAEUnknownInteract
  931. kAEUnknownSendMode
  932. KAEWaitCanceled
  933. kAEWaitReply
  934. kAEWantReceipt
  935. kAEWildType
  936. kAEWrongDataType
  937. kAEWrongVersion
  938. kAutoGenerateRefcon
  939. kCoreEventClass
  940. KeyWord
  941.  
  942. æKY kAELongType
  943. æFc AppleEvents.h
  944. æT #define
  945. æD #define kAELongType 'long'
  946. æC 
  947.  
  948. æKY kAEListType
  949. æFc AppleEvents.h
  950. æT #define
  951. æD #define kAEListType 'list'
  952. æC 
  953.  
  954. æKY kAEWildType
  955. æFc AppleEvents.h
  956. æT #define
  957. æD #define kAEWildType '****'
  958. æC 
  959.  
  960. æKY kAEBooleanType
  961. æFc AppleEvents.h
  962. æT #define
  963. æD #define kAEBooleanType 'bool'
  964. æC 
  965.  
  966. æKY kAETrueType
  967. æFc AppleEvents.h
  968. æT #define
  969. æD #define kAETrueType 'true'
  970. æC 
  971.  
  972. æKY kAEFalseType
  973. æFc AppleEvents.h
  974. æT #define
  975. æD #define kAEFalseType 'fals'
  976. æC 
  977.  
  978. æKY kAEAliasType
  979. æFc AppleEvents.h
  980. æT #define
  981. æD #define kAEAliasType 'alis'
  982. æC 
  983.  
  984. æKY kAEDirectObjectKeyword
  985. æFc AppleEvents.h
  986. æT #define
  987. æD #define kAEDirectObjectKeyword '----'
  988. æC 
  989.  
  990. æKY kCoreEventClass
  991. æFc AppleEvents.h
  992. æT #define
  993. æD #define kCoreEventClass 'aevt'
  994. æC 
  995.  
  996. æKY kAEOpenApplication
  997. æFc AppleEvents.h
  998. æT #define
  999. æD #define kAEOpenApplication 'oapp'
  1000. æC 
  1001.  
  1002. æKY kAEOpenDocuments
  1003. æFc AppleEvents.h
  1004. æT #define
  1005. æD #define kAEOpenDocuments 'odoc'
  1006. æC 
  1007.  
  1008. æKY kAEPrintDocuments
  1009. æFc AppleEvents.h
  1010. æT #define
  1011. æD #define kAEPrintDocuments 'pdoc'
  1012. æC 
  1013.  
  1014. æKY kAEQuitApplication
  1015. æFc AppleEvents.h
  1016. æT #define
  1017. æD #define kAEQuitApplication 'quit'
  1018. æC 
  1019.  
  1020. æKY kAENoReply
  1021. æFc AppleEvents.h
  1022. æT #define
  1023. æD #define kAENoReply 0x00000001 /* Sender doesn't want a reply to event */
  1024. æC 
  1025.  
  1026. æKY kAEQueueReply
  1027. æFc AppleEvents.h
  1028. æT #define
  1029. æD #define kAEQueueReply 0x00000002 /* Sender wants a reply but won't wait */
  1030. æC 
  1031.  
  1032. æKY kAEWaitReply
  1033. æFc AppleEvents.h
  1034. æT #define
  1035. æD #define kAEWaitReply 0x00000003 /* Sender wants a reply and will be waiting */
  1036. æC 
  1037.  
  1038. æKY kAENeverInteract
  1039. æFc AppleEvents.h
  1040. æT #define
  1041. æD #define kAENeverInteract 0x00000010 /* Server should not interact with user */
  1042. æC 
  1043.  
  1044. æKY kAECanInteract
  1045. æFc AppleEvents.h
  1046. æT #define
  1047. æD #define kAECanInteract 0x00000020 /* Server may try to interact with user */
  1048. æC 
  1049.  
  1050. æKY kAEAlwaysInteract
  1051. æFc AppleEvents.h
  1052. æT #define
  1053. æD #define kAEAlwaysInteract 0x00000030 /* Server should always interact with user */
  1054. æC 
  1055.  
  1056. æKY kAECanSwitchLayer
  1057. æFc AppleEvents.h
  1058. æT #define
  1059. æD #define kAECanSwitchLayer 0x00000040 /* Interaction may switch layer */
  1060. æC 
  1061.  
  1062. æKY kAEDontReconnect
  1063. æFc AppleEvents.h
  1064. æT #define
  1065. æD #define kAEDontReconnect 0x00000080 /* don't reconnect if there is a sessClosedErr */
  1066. æC 
  1067.  
  1068. æKY kAEWantReceipt
  1069. æFc AppleEvents.h
  1070. æT #define
  1071. æD #define kAEWantReceipt nReturnReceipt /* Send wants a receipt of message */
  1072. æC 
  1073.  
  1074. æKY kAENormalPriority
  1075. æFc AppleEvents.h
  1076. æT #define
  1077. æD #define kAENormalPriority 0x00000000 /* Post message at the end of event queue */
  1078. æC 
  1079.  
  1080. æKY kAEHighPriority
  1081. æFc AppleEvents.h
  1082. æT #define
  1083. æD #define kAEHighPriority nAttnMsg /* Post message at the front of the event queue */
  1084. æC 
  1085.  
  1086. æKY kAutoGenerateRefcon
  1087. æFc AppleEvents.h
  1088. æT #define
  1089. æD #define kAutoGenerateRefcon 0
  1090. æC 
  1091.  
  1092. æKY kAEEventNotInTable
  1093. æFc AppleEvents.h
  1094. æT #define
  1095. æD #define kAEEventNotInTable 0 /* Passed to the general dispatch proc if the event received was not in the dispatch table */
  1096. æC 
  1097.  
  1098. æKY kAECoercionFail
  1099. æFc AppleEvents.h
  1100. æT #define
  1101. æD 
  1102. /* Error messages in response to reading and writing buffer contents */
  1103.  
  1104. #define kAECoercionFail -1700
  1105. æC 
  1106.  
  1107. æKY kAEDescNotFound
  1108. æFc AppleEvents.h
  1109. æT #define
  1110. æD #define kAEDescNotFound -1701
  1111. æC 
  1112.  
  1113. æKY kAECorruptData
  1114. æFc AppleEvents.h
  1115. æT #define
  1116. æD #define kAECorruptData -1702
  1117. æC 
  1118.  
  1119. æKY kAEWrongDataType
  1120. æFc AppleEvents.h
  1121. æT #define
  1122. æD #define kAEWrongDataType -1703
  1123. æC 
  1124.  
  1125. æKY kAENotAEList
  1126. æFc AppleEvents.h
  1127. æT #define
  1128. æD #define kAENotAEList -1704
  1129. æC 
  1130.  
  1131. æKY kAEBadListElement
  1132. æFc AppleEvents.h
  1133. æT #define
  1134. æD #define kAEBadListElement -1705
  1135. æC 
  1136.  
  1137. æKY kAEWrongVersion
  1138. æFc AppleEvents.h
  1139. æT #define
  1140. æD #define kAEWrongVersion -1706
  1141. æC 
  1142.  
  1143. æKY kAENotAppleEvent
  1144. æFc AppleEvents.h
  1145. æT #define
  1146. æD #define kAENotAppleEvent -1707
  1147. æC 
  1148.  
  1149. æKY kAEEventNotFound
  1150. æFc AppleEvents.h
  1151. æT #define
  1152. æD 
  1153. /* Error messages in response to sending/receiving a message */
  1154.  
  1155. #define kAEEventNotFound -1708 /* The event isn't in the supplied event table */
  1156. æC 
  1157.  
  1158. æKY kAEReplyNotValid
  1159. æFc AppleEvents.h
  1160. æT #define
  1161. æD #define kAEReplyNotValid -1709 /* AEResetTimer was passed an invalid reply */
  1162. æC 
  1163.  
  1164. æKY kAEUnknownSendMode
  1165. æFc AppleEvents.h
  1166. æT #define
  1167. æD #define kAEUnknownSendMode -1710 /* Mode wasn't NoReply, WaitReply, QueueReply; or Interaction level is unknown */
  1168. æC 
  1169.  
  1170. æKY KAEWaitCanceled
  1171. æFc AppleEvents.h
  1172. æT #define
  1173. æD #define KAEWaitCanceled -1711 /* User cancelled out of wait loop for reply or receipt */
  1174. æC 
  1175.  
  1176. æKY kAETimeoutErr
  1177. æFc AppleEvents.h
  1178. æT #define
  1179. æD #define kAETimeoutErr -1712 /* AppleEvent time out */
  1180. æC 
  1181.  
  1182. æKY kAENoUserInteraction
  1183. æFc AppleEvents.h
  1184. æT #define
  1185. æD #define kAENoUserInteraction -1713 /* no user interaction allowed */
  1186. æC 
  1187.  
  1188. æKY AEArrayType
  1189. kAEDataArray
  1190. kAEPackedArray
  1191. kAEHandleArray
  1192. kAEDescArray
  1193. kAEKeyDescArray
  1194. æFc AppleEvents.h
  1195. æT enum
  1196. æD enum {kAEDataArray,kAEPackedArray,kAEHandleArray,kAEDescArray,kAEKeyDescArray};
  1197. typedef unsigned char AEArrayType;
  1198. æC 
  1199.  
  1200. æKY AEInteractAllowed
  1201. kAEUnknownInteract
  1202. kAEInteractionWithSelf
  1203. kAEInteractWithLocal
  1204. kAEInteractWithAll
  1205.  
  1206. æFc AppleEvents.h
  1207. æT enum
  1208. æD enum {kAEUnknownInteract,kAEInteractionWithSelf,kAEInteractWithLocal,kAEInteractWithAll};
  1209. typedef unsigned char AEInteractAllowed;
  1210. æC 
  1211.  
  1212. æKY AEList
  1213. æFc AppleEvents.h
  1214. æT typedef
  1215. æD typedef long AEList;
  1216. æC 
  1217.  
  1218. æKY KeyWord
  1219. æFc AppleEvents.h
  1220. æT typedef
  1221. æD typedef unsigned long KeyWord;
  1222. æC 
  1223.  
  1224. æKY EventClass
  1225. æFc AppleEvents.h
  1226. æT typedef
  1227. æD typedef unsigned long EventClass;
  1228. æC 
  1229.  
  1230. æKY EventID
  1231. æFc AppleEvents.h
  1232. æT typedef
  1233. æD typedef unsigned long EventID;
  1234. æC 
  1235.  
  1236. æKY DescType
  1237. æFc AppleEvents.h
  1238. æT typedef
  1239. æD typedef OSType DescType;
  1240. æC 
  1241.  
  1242. æKY AEAddress
  1243. AEAddressPtr
  1244. AEAddressHndl
  1245. æFc AppleEvents.h
  1246. æT struct
  1247. æD union AEAddress {
  1248.     ProcessSerialNumber receiverIDasPSN;
  1249.     OSType receiverIDasSig;
  1250.     long receiverIDasSess;
  1251.     TargetID receiverIDasTargetID;
  1252. };
  1253.  
  1254. typedef union AEAddress AEAddress;
  1255.  
  1256. typedef AEAddress *AEAddressPtr, **AEAddressHndl;
  1257.  
  1258. æC 
  1259.  
  1260. æKY AEDesc
  1261. æFc AppleEvents.h
  1262. æT struct
  1263. æD struct AEDesc {
  1264.     DescType descriptorType;
  1265.     union{
  1266.     Handle asDataHdl;
  1267.     AEList asAEList;
  1268.     }Boolean;
  1269. };
  1270.  
  1271. typedef struct AEDesc AEDesc;
  1272. æC 
  1273.  
  1274. æKY AEKeyDesc
  1275. æFc AppleEvents.h
  1276. æT struct
  1277. æD struct AEKeyDesc {
  1278.     KeyWord descKey;
  1279.     AEDesc descContent;
  1280. };
  1281.  
  1282. typedef struct AEKeyDesc AEKeyDesc;
  1283. æC 
  1284.  
  1285. æKY AEInit
  1286. æFc AppleEvents.h
  1287. æT Function
  1288. æD 
  1289. pascal OSErr AEInit(ProcPtr dispatchProc,ProcPtr coercionProc,ProcPtr nonAevtHandler); 
  1290. æDT OSErr myVariable = AEInit((ProcPtr) dispatchProc,(ProcPtr) coercionProc,(ProcPtr) nonAevtHandler);
  1291. æC 
  1292.  
  1293. æKY AEQuit
  1294. æFc AppleEvents.h
  1295. æT Function
  1296. æD 
  1297. pascal void AEQuit(void); 
  1298. æDT 
  1299. AEQuit()(void);
  1300. æC 
  1301.  
  1302. æKY AEPutPtr
  1303. æFc AppleEvents.h
  1304. æT Function
  1305. æD 
  1306. pascal OSErr AEPutPtr(AEList theList,long index,DescType typeCode,Ptr dataPtr,
  1307.     long dataSize); 
  1308. æDT OSErr myVariable = AEPutPtr((AEList) theList,(long) index,(DescType) typeCode,(Ptr) dataPtr,()
  1309.     long dataSize);
  1310. æC 
  1311.  
  1312. æKY AEPutDesc
  1313. æFc AppleEvents.h
  1314. æT Function
  1315. æD 
  1316. pascal OSErr AEPutDesc(AEList theList,long index,const AEDesc *theDesc); 
  1317. æDT OSErr myVariable = AEPutDesc((AEList) theList,(long) index,(const AEDesc *) theDesc);
  1318. æC 
  1319.  
  1320. æKY AEPutKeyPtr
  1321. æFc AppleEvents.h
  1322. æT Function
  1323. æD 
  1324. pascal OSErr AEPutKeyPtr(AEList theList,KeyWord key,DescType typeCode,Ptr dataPtr,
  1325.     long dataSize); 
  1326. æDT OSErr myVariable = AEPutKeyPtr((AEList) theList,(KeyWord) key,(DescType) typeCode,(Ptr) dataPtr,()
  1327.     long dataSize);
  1328. æC 
  1329.  
  1330. æKY AEPutKeyDesc
  1331. æFc AppleEvents.h
  1332. æT Function
  1333. æD 
  1334. pascal OSErr AEPutKeyDesc(AEList theList,KeyWord key,const AEDesc *theDesc); 
  1335. æDT OSErr myVariable = AEPutKeyDesc((AEList) theList,(KeyWord) key,(const AEDesc *) theDesc);
  1336. æC 
  1337.  
  1338. æKY AEGetNthPtr
  1339. æFc AppleEvents.h
  1340. æT Function
  1341. æD 
  1342. pascal OSErr AEGetNthPtr(AEList theList,long index,DescType desiredType,
  1343.     KeyWord *key,DescType *typeCode,Ptr dataPtr,long maxSize,long *actualSize); 
  1344. æDT OSErr myVariable = AEGetNthPtr((AEList) theList,(long) index,(DescType) desiredType,(
  1345.     KeyWord) * key,(DescType *) typeCode,(Ptr) dataPtr,(long) maxSize,(long *) actualSize);
  1346. æC 
  1347.  
  1348. æKY AEGetNthDesc
  1349. æFc AppleEvents.h
  1350. æT Function
  1351. æD 
  1352. pascal OSErr AEGetNthDesc(AEList theList,long index,DescType desiredType,
  1353.     KeyWord *key,AEDesc *theDesc); 
  1354. æDT OSErr myVariable = AEGetNthDesc((AEList) theList,(long) index,(DescType) desiredType,(
  1355.     KeyWord) * key,(AEDesc *) theDesc);
  1356. æC 
  1357.  
  1358. æKY AEGetKeyPtr
  1359. æFc AppleEvents.h
  1360. æT Function
  1361. æD 
  1362. pascal OSErr AEGetKeyPtr(AEList theList,KeyWord key,DescType desiredType,
  1363.     DescType *typeCode,Ptr dataPtr,long maxSize,long *actualSize); 
  1364. æDT OSErr myVariable = AEGetKeyPtr((AEList) theList,(KeyWord) key,(DescType) desiredType,(
  1365.     DescType) * typeCode,(Ptr) dataPtr,(long) maxSize,(long *) actualSize);
  1366. æC 
  1367.  
  1368. æKY AEGetKeyDesc
  1369. æFc AppleEvents.h
  1370. æT Function
  1371. æD 
  1372. pascal OSErr AEGetKeyDesc(AEList theList,KeyWord key,DescType desiredType,
  1373.     AEDesc *theDesc); 
  1374. æDT OSErr myVariable = AEGetKeyDesc((AEList) theList,(KeyWord) key,(DescType) desiredType,(
  1375.     AEDesc) * theDesc);
  1376. æC 
  1377.  
  1378. æKY AEGetArray
  1379. æFc AppleEvents.h
  1380. æT Function
  1381. æD 
  1382. pascal OSErr AEGetArray(AEList theList,AEArrayType arrayType,Ptr arrayPtr,
  1383.     long bufSize,DescType *elemType,long *elemSize,long *itemCount); 
  1384. æDT OSErr myVariable = AEGetArray((AEList) theList,(AEArrayType) arrayType,(Ptr) arrayPtr,()
  1385.     long bufSize,(DescType *) elemType,(long *) elemSize,(long *) itemCount);
  1386. æC 
  1387.  
  1388. æKY AEPutArray
  1389. æFc AppleEvents.h
  1390. æT Function
  1391. æD 
  1392. pascal OSErr AEPutArray(AEList theList,AEArrayType arrayType,Ptr arrayPtr,
  1393.     DescType elemType,long elemSize,long itemCount); 
  1394. æDT OSErr myVariable = AEPutArray((AEList) theList,(AEArrayType) arrayType,(Ptr) arrayPtr,()
  1395.     DescType elemType,(long) elemSize,(long) itemCount);
  1396. æC 
  1397.  
  1398. æKY AEDeleteIndex
  1399. æFc AppleEvents.h
  1400. æT Function
  1401. æD 
  1402. pascal OSErr AEDeleteIndex(AEList theList,long index); 
  1403. æDT OSErr myVariable = AEDeleteIndex((AEList) theList,(long) index);
  1404. æC 
  1405.  
  1406. æKY AEDeleteKey
  1407. æFc AppleEvents.h
  1408. æT Function
  1409. æD 
  1410. pascal OSErr AEDeleteKey(AEList theList,KeyWord key); 
  1411. æDT OSErr myVariable = AEDeleteKey((AEList) theList,(KeyWord) key);
  1412. æC 
  1413.  
  1414. æKY AECoerceDesc
  1415. æFc AppleEvents.h
  1416. æT Function
  1417. æD 
  1418. pascal OSErr AECoerceDesc(const AEDesc *desc,DescType toType,AEDesc *result); 
  1419. æDT OSErr myVariable = AECoerceDesc((const AEDesc *) desc,(DescType) toType,(AEDesc *) result);
  1420. æC 
  1421.  
  1422. æKY AEDisposeAEList
  1423. æFc AppleEvents.h
  1424. æT Function
  1425. æD 
  1426. pascal void AEDisposeAEList(AEList theArg); 
  1427. æDT 
  1428. AEDisposeAEList((AEList) theArg);
  1429. æC 
  1430.  
  1431. æKY AEDisposeAEDesc
  1432. æFc AppleEvents.h
  1433. æT Function
  1434. æD 
  1435. pascal void AEDisposeAEDesc(const AEDesc *theArg); 
  1436. æDT 
  1437. AEDisposeAEDesc((const AEDesc *) theArg);
  1438. æC 
  1439.  
  1440. æKY AECreateAevt
  1441. æFc AppleEvents.h
  1442. æT Function
  1443. æD 
  1444. pascal OSErr AECreateAevt(EventClass theEventClass,EventID theEventID,AEAdress target,
  1445.     long theRefCon,AEList *result); 
  1446. æDT OSErr myVariable = AECreateAevt((EventClass) theEventClass,(EventID) theEventID,(AEAdress) target,()
  1447.     long theRefCon,(AEList *) result);
  1448. æC 
  1449.  
  1450. æKY AEGetEventClassAndID
  1451. æFc AppleEvents.h
  1452. æT Function
  1453. æD /*  Extract the event class and id from the specified message  */
  1454. pascal void AEGetEventClassAndID(AEList theAevt,EventClass *theEventClass,
  1455.     EventID *theEventID); 
  1456. æDT /*  Extract the event class and id from the specified message  */
  1457. pascal void myVariable = AEGetEventClassAndID((AEList) theAevt,(EventClass *) theEventClass,(
  1458.     EventID) * theEventID);
  1459. æC 
  1460.  
  1461. æKY AEGetRefCon
  1462. æFc AppleEvents.h
  1463. æT Function
  1464. æD /*  Extract the event class and id from the specified message  */
  1465. pascal void AEGetRefCon(AEList theAevt,long *refCon); 
  1466. æDT /*  Extract the event class and id from the specified message  */
  1467. pascal void myVariable = AEGetRefCon((AEList) theAevt,(long *) refCon);
  1468. æC 
  1469.  
  1470. æKY AEGetAddress
  1471. æFc AppleEvents.h
  1472. æT Function
  1473. æD /*  Extract the address from the specified message  */
  1474. pascal void AEGetAddress(AEList theAevt,AEAddress *address); 
  1475. æDT /*  Extract the address from the specified message  */
  1476. pascal void myVariable = AEGetAddress((AEList) theAevt,(AEAddress *) address);
  1477. æC 
  1478.  
  1479. æKY AECreateList
  1480. æFc AppleEvents.h
  1481. æT Function
  1482. æD 
  1483. pascal OSErr AECreateList(Ptr factoringPtr,long factoredSize,Boolean isRecord,
  1484.     AEDesc *resultList); 
  1485. æDT OSErr myVariable = AECreateList((Ptr) factoringPtr,(long) factoredSize,(Boolean) isRecord,(
  1486.     AEDesc) * resultList);
  1487. æC 
  1488.  
  1489. æKY AECountListElems
  1490. æFc AppleEvents.h
  1491. æT Function
  1492. æD 
  1493. pascal long AECountListElems(AEList theList); 
  1494. æDT long myVariable = AECountListElems((AEList) theList);
  1495. æC 
  1496.  
  1497. æKY AESend
  1498. æFc AppleEvents.h
  1499. æT Function
  1500. æD 
  1501. pascal OSErr AESend(AEList theList,AEList *theReply,long sendMode,INTEGER sendPriority,
  1502.     long timeOut,ProcPtr idleProc); 
  1503. æDT OSErr myVariable = AESend((AEList) theList,(AEList *) theReply,(long) sendMode,(INTEGER) sendPriority,()
  1504.     long timeOut,(ProcPtr) idleProc);
  1505. æC 
  1506.  
  1507. æKY AEResetTimer
  1508. æFc AppleEvents.h
  1509. æT Function
  1510. æD /*  Convience routine.  Create and send a 'wait' message from the information in the reply.  */
  1511. pascal OSErr AEResetTimer(AEList reply); 
  1512. æDT /*  Convience routine.  Create and send a 'wait' message from the information in the reply.  */
  1513. pascal OSErr myVariable = AEResetTimer((AEList) reply);
  1514. æC 
  1515.  
  1516. æKY AESetAddressByPSN
  1517. æFc AppleEvents.h
  1518. æT Function
  1519. æD /*  Fill theAddressObject as receiverIDisPSN  */
  1520. pascal void AESetAddressByPSN(const ProcessSerialNumber *thePSN,AEAdress *theAddress); 
  1521. æDT /*  Fill theAddressObject as receiverIDisPSN  */
  1522. pascal void myVariable = AESetAddressByPSN((const ProcessSerialNumber *) thePSN,(AEAdress *) theAddress);
  1523. æC 
  1524.  
  1525. æKY AESetAddressBySignature
  1526. æFc AppleEvents.h
  1527. æT Function
  1528. æD /*  Fill theAddressObject as receiverIDisSignature  */
  1529. pascal void AESetAddressBySignature(OSType theSig,AEAddress *theAddress); 
  1530. æDT /*  Fill theAddressObject as receiverIDisSignature  */
  1531. pascal void myVariable = AESetAddressBySignature((OSType) theSig,(AEAddress *) theAddress);
  1532. æC 
  1533.  
  1534. æKY AESetAddressBySessionID
  1535. æFc AppleEvents.h
  1536. æT Function
  1537. æD /*  Fill theAddressObject as receiverIDisSessionID  */
  1538. pascal void AESetAddressBySessionID(long theSessionID,AEAddress *theAddress); 
  1539. æDT /*  Fill theAddressObject as receiverIDisSessionID  */
  1540. pascal void myVariable = AESetAddressBySessionID((long) theSessionID,(AEAddress *) theAddress);
  1541. æC 
  1542.  
  1543. æKY AESetAddressByTargetID
  1544. æFc AppleEvents.h
  1545. æT Function
  1546. æD /*  Fill theAddressObject as receiverIDisTargetID  */
  1547. pascal void AESetAddressByTargetID(const TargetID *theTargetID,AEAddress *theAddress); 
  1548. æDT /*  Fill theAddressObject as receiverIDisTargetID  */
  1549. pascal void myVariable = AESetAddressByTargetID((const TargetID *) theTargetID,(AEAddress *) theAddress);
  1550. æC 
  1551.  
  1552. æKY AEProcessAppleEvent
  1553. æFc AppleEvents.h
  1554. æT Function
  1555. æD 
  1556. pascal OSErr AEProcessAppleEvent(const EventRecord *eventRec); 
  1557. æDT OSErr myVariable = AEProcessAppleEvent((const EventRecord *) eventRec);
  1558. æC 
  1559.  
  1560. æKY AEGetDispatchTableRsrc
  1561. æFc AppleEvents.h
  1562. æT Function
  1563. æD /*  Load an event table from a 'AEDF' resource.  This of course will only be    of use to applications using a general dispatch routine rather than doing a direct dispatch to a handler.  */
  1564. pascal OSErr AEGetDispatchTableRsrc(INTEGER tableID); 
  1565. æDT /*  Load an event table from a 'AEDF' resource.  This of course will only be    of use to applications using a general dispatch routine rather than doing a direct dispatch to a handler.  */
  1566. pascal OSErr myVariable = AEGetDispatchTableRsrc((INTEGER) tableID);
  1567. æC 
  1568.  
  1569. æKY AECreateDispatchTable
  1570. æFc AppleEvents.h
  1571. æT Function
  1572. æD /*  Create an event table with one memory manager call for the number of events specified.  If more events are added to the table with AESetupEventTable, the table will be grown automatically.  */
  1573. pascal OSErr AECreateDispatchTable(INTEGER numEntries); 
  1574. æDT /*  Create an event table with one memory manager call for the number of events specified.  If more events are added to the table with AESetupEventTable, the table will be grown automatically.  */
  1575. pascal OSErr myVariable = AECreateDispatchTable((INTEGER) numEntries);
  1576. æC 
  1577.  
  1578. æKY AEAddEvtToTable
  1579. æFc AppleEvents.h
  1580. æT Function
  1581. æD /*  Add a single event to the table, expanding if necessary.  */
  1582. pascal OSErr AEAddEvtToTable(EventClass theEventClass,EventID theEventID,
  1583.     long value); 
  1584. æDT /*  Add a single event to the table, expanding if necessary.  */
  1585. pascal OSErr myVariable = AEAddEvtToTable((EventClass) theEventClass,(EventID) theEventID,()
  1586.     long value);
  1587. æC 
  1588.  
  1589. æKY AEGetTableEntry
  1590. æFc AppleEvents.h
  1591. æT Function
  1592. æD /*  returns the value of the specified event in theValue. kAEEventNotFound if not found.  */
  1593. pascal OSErr AEGetTableEntry(EventClass theEventClass,EventID theEventID,
  1594.     long *theValue); 
  1595. æDT /*  returns the value of the specified event in theValue. kAEEventNotFound if not found.  */
  1596. pascal OSErr myVariable = AEGetTableEntry((EventClass) theEventClass,(EventID) theEventID,(
  1597.     long) * theValue);
  1598. æC 
  1599.  
  1600. æKY AEInteractWithUser
  1601. æFc AppleEvents.h
  1602. æT Function
  1603. æD 
  1604. pascal OSErr AEInteractWithUser(long timeOut,QElemPtr nmReqPtr); 
  1605. æDT OSErr myVariable = AEInteractWithUser((long) timeOut,(QElemPtr) nmReqPtr);
  1606. æC 
  1607.  
  1608. æKY AEGetInteractLevel
  1609. æFc AppleEvents.h
  1610. æT Function
  1611. æD /*  returns kAENeverInteract, kAECanInteract or kAEAlwaysInteract  */
  1612. pascal INTEGER AEGetInteractLevel(AEList theAevt); 
  1613. æDT /*  returns kAENeverInteract, kAECanInteract or kAEAlwaysInteract  */
  1614. pascal INTEGER myVariable = AEGetInteractLevel((AEList) theAevt);
  1615. æC 
  1616.  
  1617. æKY AEInteractionAllowed
  1618. æFc AppleEvents.h
  1619. æT Function
  1620. æD 
  1621. pascal AEInteractAllowed AEInteractionAllowed(AEInteractAllowed theLevel); 
  1622. æDT AEInteractAllowed myVariable = AEInteractionAllowed((AEInteractAllowed) theLevel);
  1623. æC 
  1624.  
  1625. æKY AEWhichAevt
  1626. æFc AppleEvents.h
  1627. æT Function
  1628. æD 
  1629. pascal AEList AEWhichAevt(void); 
  1630. æDT AEList myVariable = AEWhichAevt()(void);
  1631. æC 
  1632.  
  1633.  
  1634. æKY AppleTalk.h
  1635. æKL AFPCommand
  1636. ASPAbortOS
  1637. ASPCloseAll
  1638. ASPCloseSession
  1639. ASPGetParms
  1640. ASPGetStatus
  1641. ASPOpenSession
  1642. ASPUserCommand
  1643. ASPUserWrite
  1644. ATPAddRsp
  1645. ATPCloseSocket
  1646. ATPGetRequest
  1647. ATPLoad
  1648. ATPOpenSocket
  1649. ATPReqCancel
  1650. ATPRequest
  1651. ATPResponse
  1652. ATPRspCancel
  1653. ATPSndRequest
  1654. ATPSndRsp
  1655. ATPUnload
  1656. BuildBDS
  1657. BuildDDPwds
  1658. BuildLAPwds
  1659. DDPCloseSocket
  1660. DDPOpenSocket
  1661. DDPRdCancel
  1662. DDPRead
  1663. DDPWrite
  1664. GetBridgeAddress
  1665. GetLocalZones
  1666. GetMyZone
  1667. GetNodeAddress
  1668. GetZoneList
  1669. IsATPOpen
  1670. IsMPPOpen
  1671. LAPCloseProtocol
  1672. LAPOpenProtocol
  1673. LAPRdCancel
  1674. LAPRead
  1675. LAPWrite
  1676. MPPClose
  1677. MPPOpen
  1678. NBPConfirm
  1679. NBPExtract
  1680. NBPLoad
  1681. NBPLookup
  1682. NBPRegister
  1683. NBPRemove
  1684. NBPSetEntity
  1685. NBPSetNTE
  1686. NBPUnload
  1687. OpenXPP
  1688. PAddResponse
  1689. PATalkClosePrep
  1690. PAttachPH
  1691. PCancelATalkClosePrep
  1692. PCloseATPSkt
  1693. PCloseSkt
  1694. PConfirmName
  1695. PDetachPH
  1696. PGetAppleTalkInfo
  1697. PGetRequest
  1698. PKillAllGetReq
  1699. PKillGetReq
  1700. PKillNBP
  1701. PKillSendReq
  1702. PLookupName
  1703. PNSendRequest
  1704. POpenATPSkt
  1705. POpenSkt
  1706. PRegisterName
  1707. PRelRspCB
  1708. PRelTCB
  1709. PRemoveName
  1710. PSendRequest
  1711. PSendResponse
  1712. PSetSelfSend
  1713. PWriteDDP
  1714. PWriteLAP
  1715. RemoveHdlBlocks
  1716.  
  1717. .
  1718. ABByte
  1719. ABCallType
  1720. ABProtoType
  1721. AddrBlock
  1722. afpAddAPPL
  1723. afpAddCmt
  1724. afpAddIcon
  1725. afpByteRangeLock
  1726. AFPCommandBlock
  1727. afpContLogin
  1728. afpCopyFile
  1729. afpDelete
  1730. afpDirClose
  1731. afpDirCreate
  1732. afpDTClose
  1733. afpDTOpen
  1734. afpEnumerate
  1735. afpFileCreate
  1736. afpFlush
  1737. afpForkClose
  1738. afpForkFlush
  1739. afpGetAPPL
  1740. afpGetCmt
  1741. afpGetDirParms
  1742. afpGetFileParms
  1743. afpGetFlDrParms
  1744. afpGetForkParms
  1745. afpGetIcon
  1746. afpGetSInfo
  1747. afpGetSParms
  1748. afpGetVolParms
  1749. afpGtIcnInfo
  1750. afpLogin
  1751. AFPLoginPrm
  1752. afpLogout
  1753. afpMapID
  1754. afpMapName
  1755. afpMove
  1756. afpOpenDir
  1757. afpOpenFork
  1758. afpOpenVol
  1759. afpRead
  1760. afpRename
  1761. afpRmvAPPL
  1762. afpRmvCmt
  1763. afpSetDirParms
  1764. afpSetFileParms
  1765. afpSetFlDrParms
  1766. afpSetForkParms
  1767. afpSetVolParms
  1768. afpVolClose
  1769. afpWrite
  1770. ASPAbortPrm
  1771. ASPGetparmsBlk
  1772. ASPOpenPrm
  1773. ASPOpenPrmPtr
  1774. ATATPRec
  1775. ATATPRecHandle
  1776. ATATPRecPtr
  1777. ATDDPRec
  1778. ATDDPRecHandle
  1779. ATDDPRecPtr
  1780. ATLAPRec
  1781. ATLAPRecHandle
  1782. ATLAPRecPtr
  1783. ATNBPRec
  1784. ATNBPRecHandle
  1785. ATNBPRecPtr
  1786. ATPaddrBlock
  1787. ATPaKillQEl
  1788. ATPatpFlags
  1789. ATPatpSocket
  1790. ATPbdsPointer
  1791. ATPbdsSize
  1792. ATPbitMap
  1793. ATPcsCode
  1794. atpEOMvalue
  1795. ATPioCompletion
  1796. ATPioRefNum
  1797. ATPioResult
  1798. ATPmisc1
  1799. ATPmisc2
  1800. ATPnumOfBuffs
  1801. ATPnumOfResps
  1802. ATPParamBlock
  1803. ATPparms
  1804. ATPPBPtr
  1805. atpProto
  1806. ATPreqLength
  1807. ATPreqPointer
  1808. ATPreqTID
  1809. ATPretryCount
  1810. ATPrspNum
  1811. atpSendChkvalue
  1812. atpSize
  1813. atpSTSvalue
  1814. atpTIDValidvalue
  1815. ATPtimeOutVal
  1816. ATPtransID
  1817. ATPuserData
  1818. atpXOvalue
  1819. ATQEntry
  1820. BDSElement
  1821. BitMapType
  1822. DDPchecksumFlag
  1823. DDPlistener
  1824. DDPparms
  1825. ddpProto
  1826. ddpSize
  1827. DDPsocket
  1828. DDPwdsPointer
  1829. EntityName
  1830. EntityPtr
  1831. Killparms
  1832. LAPAdrBlock
  1833. LAPhandler
  1834. LAPMgrCall
  1835. LAPMgrPtr
  1836. LAPparms
  1837. lapProto
  1838. LAPprotType
  1839. lapSize
  1840. LAPwdsPointer
  1841. MOREATPHeader
  1842. MPPATPHeader
  1843. MPPcsCode
  1844. MPPioCompletion
  1845. MPPioRefNum
  1846. MPPioResult
  1847. MPPParamBlock
  1848. MPPparms
  1849. MPPPBPtr
  1850. NamesTableEntry
  1851. NBPconfirmAddr
  1852. NBPcount
  1853. NBPentityPtr
  1854. NBPinterval
  1855. NBPKillparms
  1856. NBPmaxToGet
  1857. NBPnewSocket
  1858. NBPnKillQEl
  1859. NBPntQElPtr
  1860. NBPnumGotten
  1861. NBPparms
  1862. nbpProto
  1863. NBPretBuffPtr
  1864. NBPretBuffSize
  1865. nbpSize
  1866. NBPverifyFlag
  1867. NTElement
  1868. RetransType
  1869. scbMemSize
  1870. SendReqparms
  1871. SetSelfparms
  1872. Str32
  1873. tATPAddRsp
  1874. tATPGetRequest
  1875. tATPRequest
  1876. tATPResponse
  1877. tATPSdRsp
  1878. tATPSndRequest
  1879. tDDPRead
  1880. tDDPWrite
  1881. tLAPRead
  1882. tLAPWrite
  1883. tNBPConfirm
  1884. tNBPLookup
  1885. tNBPRegister
  1886. WDSElement
  1887. xppFlagClr
  1888. xppFlagSet
  1889. xppLoadedBit
  1890. XPPParamBlock
  1891. XPPParmBlkPtr
  1892. XPPPBHeader
  1893. XPPPrmBlk
  1894. xppRefNum
  1895. xppUnitNum
  1896.  
  1897. æKY afpByteRangeLock
  1898. æFc AppleTalk.h
  1899. æT #define
  1900. æD #define afpByteRangeLock 1 /*AFPCall command codes*/
  1901. æC 
  1902.  
  1903. æKY afpVolClose
  1904. æFc AppleTalk.h
  1905. æT #define
  1906. æD #define afpVolClose 2 /*AFPCall command codes*/
  1907. æC 
  1908.  
  1909. æKY afpDirClose
  1910. æFc AppleTalk.h
  1911. æT #define
  1912. æD #define afpDirClose 3 /*AFPCall command codes*/
  1913. æC 
  1914.  
  1915. æKY afpForkClose
  1916. æFc AppleTalk.h
  1917. æT #define
  1918. æD #define afpForkClose 4 /*AFPCall command codes*/
  1919. æC 
  1920.  
  1921. æKY afpCopyFile
  1922. æFc AppleTalk.h
  1923. æT #define
  1924. æD #define afpCopyFile 5 /*AFPCall command codes*/
  1925. æC 
  1926.  
  1927. æKY afpDirCreate
  1928. æFc AppleTalk.h
  1929. æT #define
  1930. æD #define afpDirCreate 6 /*AFPCall command codes*/
  1931. æC 
  1932.  
  1933. æKY afpFileCreate
  1934. æFc AppleTalk.h
  1935. æT #define
  1936. æD #define afpFileCreate 7 /*AFPCall command codes*/
  1937. æC 
  1938.  
  1939. æKY afpDelete
  1940. æFc AppleTalk.h
  1941. æT #define
  1942. æD #define afpDelete 8 /*AFPCall command codes*/
  1943. æC 
  1944.  
  1945. æKY afpEnumerate
  1946. æFc AppleTalk.h
  1947. æT #define
  1948. æD #define afpEnumerate 9 /*AFPCall command codes*/
  1949. æC 
  1950.  
  1951. æKY afpFlush
  1952. æFc AppleTalk.h
  1953. æT #define
  1954. æD #define afpFlush 10 /*AFPCall command codes*/
  1955. æC 
  1956.  
  1957. æKY afpForkFlush
  1958. æFc AppleTalk.h
  1959. æT #define
  1960. æD #define afpForkFlush 11 /*AFPCall command codes*/
  1961. æC 
  1962.  
  1963. æKY afpGetDirParms
  1964. æFc AppleTalk.h
  1965. æT #define
  1966. æD #define afpGetDirParms 12 /*AFPCall command codes*/
  1967. æC 
  1968.  
  1969. æKY afpGetFileParms
  1970. æFc AppleTalk.h
  1971. æT #define
  1972. æD #define afpGetFileParms 13 /*AFPCall command codes*/
  1973. æC 
  1974.  
  1975. æKY afpGetForkParms
  1976. æFc AppleTalk.h
  1977. æT #define
  1978. æD #define afpGetForkParms 14 /*AFPCall command codes*/
  1979. æC 
  1980.  
  1981. æKY afpGetSInfo
  1982. æFc AppleTalk.h
  1983. æT #define
  1984. æD #define afpGetSInfo 15 /*AFPCall command codes*/
  1985. æC 
  1986.  
  1987. æKY afpGetSParms
  1988. æFc AppleTalk.h
  1989. æT #define
  1990. æD #define afpGetSParms 16 /*AFPCall command codes*/
  1991. æC 
  1992.  
  1993. æKY afpGetVolParms
  1994. æFc AppleTalk.h
  1995. æT #define
  1996. æD #define afpGetVolParms 17 /*AFPCall command codes*/
  1997. æC 
  1998.  
  1999. æKY afpLogin
  2000. æFc AppleTalk.h
  2001. æT #define
  2002. æD #define afpLogin 18 /*AFPCall command codes*/
  2003. æC 
  2004.  
  2005. æKY afpContLogin
  2006. æFc AppleTalk.h
  2007. æT #define
  2008. æD #define afpContLogin 19 /*AFPCall command codes*/
  2009. æC 
  2010.  
  2011. æKY afpLogout
  2012. æFc AppleTalk.h
  2013. æT #define
  2014. æD #define afpLogout 20 /*AFPCall command codes*/
  2015. æC 
  2016.  
  2017. æKY afpMapID
  2018. æFc AppleTalk.h
  2019. æT #define
  2020. æD #define afpMapID 21 /*AFPCall command codes*/
  2021. æC 
  2022.  
  2023. æKY afpMapName
  2024. æFc AppleTalk.h
  2025. æT #define
  2026. æD #define afpMapName 22 /*AFPCall command codes*/
  2027. æC 
  2028.  
  2029. æKY afpMove
  2030. æFc AppleTalk.h
  2031. æT #define
  2032. æD #define afpMove 23 /*AFPCall command codes*/
  2033. æC 
  2034.  
  2035. æKY afpOpenVol
  2036. æFc AppleTalk.h
  2037. æT #define
  2038. æD #define afpOpenVol 24 /*AFPCall command codes*/
  2039. æC 
  2040.  
  2041. æKY afpOpenDir
  2042. æFc AppleTalk.h
  2043. æT #define
  2044. æD #define afpOpenDir 25 /*AFPCall command codes*/
  2045. æC 
  2046.  
  2047. æKY afpOpenFork
  2048. æFc AppleTalk.h
  2049. æT #define
  2050. æD #define afpOpenFork 26 /*AFPCall command codes*/
  2051. æC 
  2052.  
  2053. æKY afpRead
  2054. æFc AppleTalk.h
  2055. æT #define
  2056. æD #define afpRead 27 /*AFPCall command codes*/
  2057. æC 
  2058.  
  2059. æKY afpRename
  2060. æFc AppleTalk.h
  2061. æT #define
  2062. æD #define afpRename 28 /*AFPCall command codes*/
  2063. æC 
  2064.  
  2065. æKY afpSetDirParms
  2066. æFc AppleTalk.h
  2067. æT #define
  2068. æD #define afpSetDirParms 29 /*AFPCall command codes*/
  2069. æC 
  2070.  
  2071. æKY afpSetFileParms
  2072. æFc AppleTalk.h
  2073. æT #define
  2074. æD #define afpSetFileParms 30 /*AFPCall command codes*/
  2075. æC 
  2076.  
  2077. æKY afpSetForkParms
  2078. æFc AppleTalk.h
  2079. æT #define
  2080. æD #define afpSetForkParms 31 /*AFPCall command codes*/
  2081. æC 
  2082.  
  2083. æKY afpSetVolParms
  2084. æFc AppleTalk.h
  2085. æT #define
  2086. æD #define afpSetVolParms 32 /*AFPCall command codes*/
  2087. æC 
  2088.  
  2089. æKY afpWrite
  2090. æFc AppleTalk.h
  2091. æT #define
  2092. æD #define afpWrite 33 /*AFPCall command codes*/
  2093. æC 
  2094.  
  2095. æKY afpGetFlDrParms
  2096. æFc AppleTalk.h
  2097. æT #define
  2098. æD #define afpGetFlDrParms 34 /*AFPCall command codes*/
  2099. æC 
  2100.  
  2101. æKY afpSetFlDrParms
  2102. æFc AppleTalk.h
  2103. æT #define
  2104. æD #define afpSetFlDrParms 35 /*AFPCall command codes*/
  2105. æC 
  2106.  
  2107. æKY afpDTOpen
  2108. æFc AppleTalk.h
  2109. æT #define
  2110. æD #define afpDTOpen 48 /*AFPCall command codes*/
  2111. æC 
  2112.  
  2113. æKY afpDTClose
  2114. æFc AppleTalk.h
  2115. æT #define
  2116. æD #define afpDTClose 49 /*AFPCall command codes*/
  2117. æC 
  2118.  
  2119. æKY afpGetIcon
  2120. æFc AppleTalk.h
  2121. æT #define
  2122. æD #define afpGetIcon 51 /*AFPCall command codes*/
  2123. æC 
  2124.  
  2125. æKY afpGtIcnInfo
  2126. æFc AppleTalk.h
  2127. æT #define
  2128. æD #define afpGtIcnInfo 52 /*AFPCall command codes*/
  2129. æC 
  2130.  
  2131. æKY afpAddAPPL
  2132. æFc AppleTalk.h
  2133. æT #define
  2134. æD #define afpAddAPPL 53 /*AFPCall command codes*/
  2135. æC 
  2136.  
  2137. æKY afpRmvAPPL
  2138. æFc AppleTalk.h
  2139. æT #define
  2140. æD #define afpRmvAPPL 54 /*AFPCall command codes*/
  2141. æC 
  2142.  
  2143. æKY afpGetAPPL
  2144. æFc AppleTalk.h
  2145. æT #define
  2146. æD #define afpGetAPPL 55 /*AFPCall command codes*/
  2147. æC 
  2148.  
  2149. æKY afpAddCmt
  2150. æFc AppleTalk.h
  2151. æT #define
  2152. æD #define afpAddCmt 56 /*AFPCall command codes*/
  2153. æC 
  2154.  
  2155. æKY afpRmvCmt
  2156. æFc AppleTalk.h
  2157. æT #define
  2158. æD #define afpRmvCmt 57 /*AFPCall command codes*/
  2159. æC 
  2160.  
  2161. æKY afpGetCmt
  2162. æFc AppleTalk.h
  2163. æT #define
  2164. æD #define afpGetCmt 58 /*AFPCall command codes*/
  2165. æC 
  2166.  
  2167. æKY afpAddIcon
  2168. æFc AppleTalk.h
  2169. æT #define
  2170. æD #define afpAddIcon 192 /*Special code for ASP Write commands*/
  2171. æC 
  2172.  
  2173. æKY xppLoadedBit
  2174. æFc AppleTalk.h
  2175. æT #define
  2176. æD #define xppLoadedBit 5 /* XPP bit in PortBUse */
  2177. æC 
  2178.  
  2179. æKY xppUnitNum
  2180. æFc AppleTalk.h
  2181. æT #define
  2182. æD #define xppUnitNum 40 /*Unit number for XPP (old ROMs) */
  2183. æC 
  2184.  
  2185. æKY xppRefNum
  2186. æFc AppleTalk.h
  2187. æT #define
  2188. æD #define xppRefNum -41 /*.XPP reference number */
  2189. æC 
  2190.  
  2191. æKY scbMemSize
  2192. æFc AppleTalk.h
  2193. æT #define
  2194. æD #define scbMemSize 192 /*Size of memory for SCB */
  2195. æC 
  2196.  
  2197. æKY xppFlagClr
  2198. æFc AppleTalk.h
  2199. æT #define
  2200. æD #define xppFlagClr 0 /*Cs for AFPCommandBlock */
  2201. æC 
  2202.  
  2203. æKY xppFlagSet
  2204. æFc AppleTalk.h
  2205. æT #define
  2206. æD #define xppFlagSet 128 /*StartEndFlag & NewLineFlag fields. */
  2207. æC 
  2208.  
  2209. æKY lapSize
  2210. æFc AppleTalk.h
  2211. æT #define
  2212. æD #define lapSize 20
  2213. æC 
  2214.  
  2215. æKY ddpSize
  2216. æFc AppleTalk.h
  2217. æT #define
  2218. æD #define ddpSize 26
  2219. æC 
  2220.  
  2221. æKY nbpSize
  2222. æFc AppleTalk.h
  2223. æT #define
  2224. æD #define nbpSize 26
  2225. æC 
  2226.  
  2227. æKY atpSize
  2228. æFc AppleTalk.h
  2229. æT #define
  2230. æD #define atpSize 56
  2231. æC 
  2232.  
  2233. æKY MPPioCompletion
  2234. æFc AppleTalk.h
  2235. æT #define
  2236. æD #define MPPioCompletion MPP.ioCompletion
  2237. æC 
  2238.  
  2239. æKY MPPioResult
  2240. æFc AppleTalk.h
  2241. æT #define
  2242. æD #define MPPioResult MPP.ioResult
  2243. æC 
  2244.  
  2245. æKY MPPioRefNum
  2246. æFc AppleTalk.h
  2247. æT #define
  2248. æD #define MPPioRefNum MPP.ioRefNum
  2249. æC 
  2250.  
  2251. æKY MPPcsCode
  2252. æFc AppleTalk.h
  2253. æT #define
  2254. æD #define MPPcsCode MPP.csCode
  2255. æC 
  2256.  
  2257. æKY LAPprotType
  2258. æFc AppleTalk.h
  2259. æT #define
  2260. æD #define LAPprotType LAP.protType
  2261. æC 
  2262.  
  2263. æKY LAPwdsPointer
  2264. æFc AppleTalk.h
  2265. æT #define
  2266. æD #define LAPwdsPointer LAP.LAPptrs.wdsPointer
  2267. æC 
  2268.  
  2269. æKY LAPhandler
  2270. æFc AppleTalk.h
  2271. æT #define
  2272. æD #define LAPhandler LAP.LAPptrs.handler
  2273. æC 
  2274.  
  2275. æKY DDPsocket
  2276. æFc AppleTalk.h
  2277. æT #define
  2278. æD #define DDPsocket DDP.socket
  2279. æC 
  2280.  
  2281. æKY DDPchecksumFlag
  2282. æFc AppleTalk.h
  2283. æT #define
  2284. æD #define DDPchecksumFlag DDP.checksumFlag
  2285. æC 
  2286.  
  2287. æKY DDPwdsPointer
  2288. æFc AppleTalk.h
  2289. æT #define
  2290. æD #define DDPwdsPointer DDP.DDPptrs.wdsPointer
  2291. æC 
  2292.  
  2293. æKY DDPlistener
  2294. æFc AppleTalk.h
  2295. æT #define
  2296. æD #define DDPlistener DDP.DDPptrs.listener
  2297. æC 
  2298.  
  2299. æKY NBPinterval
  2300. æFc AppleTalk.h
  2301. æT #define
  2302. æD #define NBPinterval NBP.interval
  2303. æC 
  2304.  
  2305. æKY NBPcount
  2306. æFc AppleTalk.h
  2307. æT #define
  2308. æD #define NBPcount NBP.count
  2309. æC 
  2310.  
  2311. æKY NBPntQElPtr
  2312. æFc AppleTalk.h
  2313. æT #define
  2314. æD #define NBPntQElPtr NBP.NBPPtrs.ntQElPtr
  2315. æC 
  2316.  
  2317. æKY NBPentityPtr
  2318. æFc AppleTalk.h
  2319. æT #define
  2320. æD #define NBPentityPtr NBP.NBPPtrs.entityPtr
  2321. æC 
  2322.  
  2323. æKY NBPverifyFlag
  2324. æFc AppleTalk.h
  2325. æT #define
  2326. æD #define NBPverifyFlag NBP.parm.verifyFlag
  2327. æC 
  2328.  
  2329. æKY NBPretBuffPtr
  2330. æFc AppleTalk.h
  2331. æT #define
  2332. æD #define NBPretBuffPtr NBP.parm.Lookup.retBuffPtr
  2333. æC 
  2334.  
  2335. æKY NBPretBuffSize
  2336. æFc AppleTalk.h
  2337. æT #define
  2338. æD #define NBPretBuffSize NBP.parm.Lookup.retBuffSize
  2339. æC 
  2340.  
  2341. æKY NBPmaxToGet
  2342. æFc AppleTalk.h
  2343. æT #define
  2344. æD #define NBPmaxToGet NBP.parm.Lookup.maxToGet
  2345. æC 
  2346.  
  2347. æKY NBPnumGotten
  2348. æFc AppleTalk.h
  2349. æT #define
  2350. æD #define NBPnumGotten NBP.parm.Lookup.numGotten
  2351. æC 
  2352.  
  2353. æKY NBPconfirmAddr
  2354. æFc AppleTalk.h
  2355. æT #define
  2356. æD #define NBPconfirmAddr NBP.parm.Confirm.confirmAddr
  2357. æC 
  2358.  
  2359. æKY NBPnKillQEl
  2360. æFc AppleTalk.h
  2361. æT #define
  2362. æD #define NBPnKillQEl NBPKILL.nKillQEl
  2363. æC 
  2364.  
  2365. æKY NBPnewSocket
  2366. æFc AppleTalk.h
  2367. æT #define
  2368. æD #define NBPnewSocket NBP.parm.Confirm.newSocket
  2369. æC 
  2370.  
  2371. æKY ATPioCompletion
  2372. æFc AppleTalk.h
  2373. æT #define
  2374. æD #define ATPioCompletion ATP.ioCompletion
  2375. æC 
  2376.  
  2377. æKY ATPioResult
  2378. æFc AppleTalk.h
  2379. æT #define
  2380. æD #define ATPioResult ATP.ioResult
  2381. æC 
  2382.  
  2383. æKY ATPuserData
  2384. æFc AppleTalk.h
  2385. æT #define
  2386. æD #define ATPuserData ATP.userData
  2387. æC 
  2388.  
  2389. æKY ATPreqTID
  2390. æFc AppleTalk.h
  2391. æT #define
  2392. æD #define ATPreqTID ATP.reqTID
  2393. æC 
  2394.  
  2395. æKY ATPioRefNum
  2396. æFc AppleTalk.h
  2397. æT #define
  2398. æD #define ATPioRefNum ATP.ioRefNum
  2399. æC 
  2400.  
  2401. æKY ATPcsCode
  2402. æFc AppleTalk.h
  2403. æT #define
  2404. æD #define ATPcsCode ATP.csCode
  2405. æC 
  2406.  
  2407. æKY ATPatpSocket
  2408. æFc AppleTalk.h
  2409. æT #define
  2410. æD #define ATPatpSocket ATP.atpSocket
  2411. æC 
  2412.  
  2413. æKY ATPatpFlags
  2414. æFc AppleTalk.h
  2415. æT #define
  2416. æD #define ATPatpFlags ATP.atpFlags
  2417. æC 
  2418.  
  2419. æKY ATPaddrBlock
  2420. æFc AppleTalk.h
  2421. æT #define
  2422. æD #define ATPaddrBlock ATP.addrBlock
  2423. æC 
  2424.  
  2425. æKY ATPreqLength
  2426. æFc AppleTalk.h
  2427. æT #define
  2428. æD #define ATPreqLength ATP.reqLength
  2429. æC 
  2430.  
  2431. æKY ATPreqPointer
  2432. æFc AppleTalk.h
  2433. æT #define
  2434. æD #define ATPreqPointer ATP.reqPointer
  2435. æC 
  2436.  
  2437. æKY ATPbdsPointer
  2438. æFc AppleTalk.h
  2439. æT #define
  2440. æD #define ATPbdsPointer ATP.bdsPointer
  2441. æC 
  2442.  
  2443. æKY ATPtimeOutVal
  2444. æFc AppleTalk.h
  2445. æT #define
  2446. æD #define ATPtimeOutVal SREQ.timeOutVal
  2447. æC 
  2448.  
  2449. æKY ATPnumOfResps
  2450. æFc AppleTalk.h
  2451. æT #define
  2452. æD #define ATPnumOfResps SREQ.numOfResps
  2453. æC 
  2454.  
  2455. æKY ATPretryCount
  2456. æFc AppleTalk.h
  2457. æT #define
  2458. æD #define ATPretryCount SREQ.retryCount
  2459. æC 
  2460.  
  2461. æKY ATPnumOfBuffs
  2462. æFc AppleTalk.h
  2463. æT #define
  2464. æD #define ATPnumOfBuffs OTH1.u0.numOfBuffs
  2465. æC 
  2466.  
  2467. æKY ATPbitMap
  2468. æFc AppleTalk.h
  2469. æT #define
  2470. æD #define ATPbitMap OTH1.u0.bitMap
  2471. æC 
  2472.  
  2473. æKY ATPrspNum
  2474. æFc AppleTalk.h
  2475. æT #define
  2476. æD #define ATPrspNum OTH1.u0.rspNum
  2477. æC 
  2478.  
  2479. æKY ATPbdsSize
  2480. æFc AppleTalk.h
  2481. æT #define
  2482. æD #define ATPbdsSize OTH2.bdsSize
  2483. æC 
  2484.  
  2485. æKY ATPtransID
  2486. æFc AppleTalk.h
  2487. æT #define
  2488. æD #define ATPtransID OTH2.transID
  2489. æC 
  2490.  
  2491. æKY ATPaKillQEl
  2492. æFc AppleTalk.h
  2493. æT #define
  2494. æD #define ATPaKillQEl KILL.aKillQEl
  2495. æC 
  2496.  
  2497. æKY atpXOvalue
  2498. æFc AppleTalk.h
  2499. æT #define
  2500. æD #define atpXOvalue 32 /*ATP exactly-once bit */
  2501. æC 
  2502.  
  2503. æKY atpEOMvalue
  2504. æFc AppleTalk.h
  2505. æT #define
  2506. æD #define atpEOMvalue 16 /*ATP End-Of-Message bit */
  2507. æC 
  2508.  
  2509. æKY atpSTSvalue
  2510. æFc AppleTalk.h
  2511. æT #define
  2512. æD #define atpSTSvalue 8 /*ATP Send-Transmission-Status bit */
  2513. æC 
  2514.  
  2515. æKY atpTIDValidvalue
  2516. æFc AppleTalk.h
  2517. æT #define
  2518. æD #define atpTIDValidvalue 2 /*ATP trans. ID valid bit */
  2519. æC 
  2520.  
  2521. æKY atpSendChkvalue
  2522. æFc AppleTalk.h
  2523. æT #define
  2524. æD #define atpSendChkvalue 1 /*ATP send checksum bit */
  2525. æC 
  2526.  
  2527. æKY LAPMgrPtr
  2528. æFc AppleTalk.h
  2529. æT #define
  2530. æD #define LAPMgrPtr 0xB18 /*Entry point for LAP Manager*/
  2531. æC 
  2532.  
  2533. æKY LAPMgrCall
  2534. æFc AppleTalk.h
  2535. æT #define
  2536. æD #define LAPMgrCall 2 /*Offset to LAP routines*/
  2537. æC 
  2538.  
  2539. æKY ABCallType
  2540. tLAPRead
  2541. tLAPWrite
  2542. tDDPRead
  2543. tDDPWrite
  2544. tNBPLookup
  2545. tNBPConfirm
  2546. tNBPRegister
  2547. tATPSndRequest
  2548. tATPGetRequest
  2549. tATPSdRsp
  2550. tATPAddRsp
  2551. tATPRequest
  2552. tATPResponse
  2553. æFc AppleTalk.h
  2554. æT enum
  2555. æD enum {tLAPRead,tLAPWrite,tDDPRead,tDDPWrite,tNBPLookup,tNBPConfirm,tNBPRegister,
  2556.     tATPSndRequest,tATPGetRequest,tATPSdRsp,tATPAddRsp,tATPRequest,tATPResponse};
  2557. typedef unsigned char ABCallType;
  2558. æC 
  2559.  
  2560. æKY ABProtoType
  2561. lapProto
  2562. ddpProto
  2563. nbpProto
  2564. atpProto
  2565. æFc AppleTalk.h
  2566. æT enum
  2567. æD enum {lapProto,ddpProto,nbpProto,atpProto};
  2568. typedef unsigned char ABProtoType;
  2569. æC 
  2570.  
  2571. æKY ABByte
  2572. .
  2573. æFc AppleTalk.h
  2574. æT typedef
  2575. æD typedef unsigned char ABByte;
  2576. æC 
  2577.  
  2578. æKY BitMapType
  2579. æFc AppleTalk.h
  2580. æT typedef
  2581. æD typedef char BitMapType;
  2582. æC 
  2583.  
  2584. æKY Str32
  2585. æFc AppleTalk.h
  2586. æT typedef
  2587. æD typedef char Str32[33];
  2588. æC 
  2589.  
  2590. æKY LAPAdrBlock
  2591. æFc AppleTalk.h
  2592. æT struct
  2593. æD struct LAPAdrBlock {
  2594.     unsigned char dstNodeID;
  2595.     unsigned char srcNodeID;
  2596.     ABByte lapProtType;
  2597. };
  2598.  
  2599. typedef struct LAPAdrBlock LAPAdrBlock;
  2600. æC 
  2601.  
  2602. æKY ATQEntry
  2603. æFc AppleTalk.h
  2604. æT struct
  2605. æD struct ATQEntry {
  2606.     QElemPtr qLink; /*next queue entry*/
  2607.     Integer qType; /*queue type*/
  2608.     ProcPtr CallAddr; /*Pointer to your routine*/
  2609. };
  2610.  
  2611. typedef struct ATQEntry ATQEntry;
  2612. typedef ATQEntry *ATQEntry;
  2613.  
  2614. æC 
  2615.  
  2616. æKY AddrBlock
  2617. æFc AppleTalk.h
  2618. æT struct
  2619. æD struct AddrBlock {
  2620.     short aNet;
  2621.     unsigned char aNode;
  2622.     unsigned char aSocket;
  2623. };
  2624.  
  2625. typedef struct AddrBlock AddrBlock;
  2626. æC 
  2627.  
  2628. æKY EntityName
  2629. EntityPtr
  2630. æFc AppleTalk.h
  2631. æT struct
  2632. æD struct EntityName {
  2633.     Str32 objStr;
  2634.     char pad1; /*Str32's aligned on even word boundries.*/
  2635.     Str32 typeStr;
  2636.     char pad2;
  2637.     Str32 zoneStr;
  2638.     char pad3;
  2639. };
  2640.  
  2641. typedef struct EntityName EntityName;
  2642. typedef EntityName *EntityPtr;
  2643.  
  2644. /* Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  2645. offests for Asm since each String address must be calculated by adding length byte to last string ptr. 
  2646. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  2647. only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not 
  2648. be the same, which is OK since they are not used. */
  2649. æC \* Real definition of EntityName is 3 PACKED strings of any length (32 is just an 
  2650. example). No offsets for Asm since each String address must be calculated by adding 
  2651. length byte to last string ptr. 
  2652.  
  2653. In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte 
  2654. unless they are only a byte long. So this will generate correct looking interfaces for 
  2655. Pascal and C, but they will not be the same, which is OK since they are not used. */
  2656.  
  2657. æKY RetransType
  2658. æFc AppleTalk.h
  2659. æT struct
  2660. æD struct RetransType {
  2661.     unsigned char retransInterval;
  2662.     unsigned char retransCount;
  2663. };
  2664.  
  2665. typedef struct RetransType RetransType;
  2666. æC 
  2667.  
  2668. æKY BDSElement
  2669. æFc AppleTalk.h
  2670. æT struct
  2671. æD struct BDSElement {
  2672.     short buffSize;
  2673.     Ptr buffPtr;
  2674.     short dataSize;
  2675.     long userBytes;
  2676. };
  2677.  
  2678. typedef struct BDSElement BDSElement;
  2679. typedef BDSElement BDSType[8];
  2680. typedef BDSType *BDSPtr;
  2681.  
  2682.  
  2683. æC 
  2684.  
  2685. æKY ATLAPRec
  2686. ATLAPRecPtr
  2687. ATLAPRecHandle
  2688. æFc AppleTalk.h
  2689. æT struct
  2690. æD struct ATLAPRec {
  2691.     ABCallType abOpcode;
  2692.     short abResult;
  2693.     long abUserReference;
  2694.     LAPAdrBlock lapAddress;
  2695.     short lapReqCount;
  2696.     short lapActCount;
  2697.     Ptr lapDataPtr;
  2698. };
  2699.  
  2700. typedef struct ATLAPRec ATLAPRec;
  2701. typedef ATLAPRec *ATLAPRecPtr, **ATLAPRecHandle;
  2702.  
  2703. æC 
  2704.  
  2705. æKY ATDDPRec
  2706. ATDDPRecPtr
  2707. ATDDPRecHandle
  2708. æFc AppleTalk.h
  2709. æT struct
  2710. æD struct ATDDPRec {
  2711.     ABCallType abOpcode;
  2712.     short abResult;
  2713.     long abUserReference;
  2714.     short ddpType;
  2715.     short ddpSocket;
  2716.     AddrBlock ddpAddress;
  2717.     short ddpReqCount;
  2718.     short ddpActCount;
  2719.     Ptr ddpDataPtr;
  2720.     short ddpNodeID;
  2721. };
  2722.  
  2723. typedef struct ATDDPRec ATDDPRec;
  2724. typedef ATDDPRec *ATDDPRecPtr, **ATDDPRecHandle;
  2725.  
  2726. æC 
  2727.  
  2728. æKY ATNBPRec
  2729. ATNBPRecPtr
  2730. ATNBPRecHandle
  2731. æFc AppleTalk.h
  2732. æT struct
  2733. æD struct ATNBPRec {
  2734.     ABCallType abOpcode;
  2735.     short abResult;
  2736.     long abUserReference;
  2737.     EntityPtr nbpEntityPtr;
  2738.     Ptr nbpBufPtr;
  2739.     short nbpBufSize;
  2740.     short nbpDataField;
  2741.     AddrBlock nbpAddress;
  2742.     RetransType nbpRetransmitInfo;
  2743. };
  2744.  
  2745. typedef struct ATNBPRec ATNBPRec;
  2746. typedef ATNBPRec *ATNBPRecPtr, **ATNBPRecHandle;
  2747.  
  2748. æC 
  2749.  
  2750. æKY ATATPRec
  2751. ATATPRecPtr
  2752. ATATPRecHandle
  2753. æFc AppleTalk.h
  2754. æT struct
  2755. æD struct ATATPRec {
  2756.     ABCallType abOpcode;
  2757.     short abResult;
  2758.     long abUserReference;
  2759.     short atpSocket;
  2760.     AddrBlock atpAddress;
  2761.     short atpReqCount;
  2762.     Ptr atpDataPtr;
  2763.     BDSPtr atpRspBDSPtr;
  2764.     BitMapType atpBitMap;
  2765.     short atpTransID;
  2766.     short atpActCount;
  2767.     long atpUserData;
  2768.     Boolean atpXO;
  2769.     Boolean atpEOM;
  2770.     short atpTimeOut;
  2771.     short atpRetries;
  2772.     short atpNumBufs;
  2773.     short atpNumRsp;
  2774.     short atpBDSSize;
  2775.     long atpRspUData;
  2776.     Ptr atpRspBuf;
  2777.     short atpRspSize;
  2778. };
  2779.  
  2780. typedef struct ATATPRec ATATPRec;
  2781. typedef ATATPRec *ATATPRecPtr, **ATATPRecHandle;
  2782.  
  2783. æC 
  2784.  
  2785. æKY AFPCommandBlock
  2786. æFc AppleTalk.h
  2787. æT struct
  2788. æD typedef struct {
  2789.     char cmdByte;
  2790.     char startEndFlag;
  2791.     short forkRefNum;
  2792.     long rwOffset;
  2793.     long reqCount;
  2794.     char newLineFlag;
  2795.     char newLineChar;
  2796. }AFPCommandBlock;
  2797.  
  2798. æC 
  2799.  
  2800. æKY XPPPBHeader
  2801. æFc AppleTalk.h
  2802. æT struct
  2803. æD #define XPPPBHeader \
  2804.     QElem *qLink;
  2805.     short qType;
  2806.     short ioTrap;
  2807.     Ptr ioCmdAddr;
  2808.     ProcPtr ioCompletion;
  2809.     OSErr ioResult;
  2810.     long cmdResult;
  2811.     short ioVRefNum;
  2812.     short ioRefNum;
  2813.     short csCode;
  2814.  
  2815.  
  2816. æC 
  2817.  
  2818. æKY XPPPrmBlk
  2819. æFc AppleTalk.h
  2820. æT struct
  2821. æD typedef struct {
  2822.     XPPPBHeader 
  2823.     short sessRefnum; /*Offset to session refnum*/
  2824.     char aspTimeout; /*Timeout for ATP*/
  2825.     char aspRetry; /*Retry count for ATP*/
  2826.     short cbSize; /*Command block size*/
  2827.     Ptr cbPtr; /*Command block pointer*/
  2828.     short rbSize; /*Reply buffer size*/
  2829.     Ptr rbPtr; /*Reply buffer pointer*/
  2830.     short wdSize; /*Write Data size*/
  2831.     Ptr wdPtr; /*Write Data pointer*/
  2832.     char ccbStart[296]; /*CCB memory allocated for driver afpWrite max size(CCB)=296 all other calls=150*/
  2833. }XPPPrmBlk;
  2834.  
  2835. æC 
  2836.  
  2837. æKY AFPLoginPrm
  2838. æFc AppleTalk.h
  2839. æT struct
  2840. æD typedef struct {
  2841.     XPPPBHeader 
  2842.     short sessRefnum; /*Offset to session refnum */
  2843.     char aspTimeout; /*Timeout for ATP */
  2844.     char aspRetry; /*Retry count for ATP */
  2845.     short cbSize; /*Command block size */
  2846.     Ptr cbPtr; /*Command block pointer */
  2847.     short rbSize; /*Reply buffer size */
  2848.     Ptr rbPtr; /*Reply buffer pointer */
  2849.     AddrBlock afpAddrBlock; /*block in AFP login */
  2850.     Ptr afpSCBPtr; /*SCB pointer in AFP login */
  2851.     Ptr afpAttnRoutine; /*routine pointer in AFP login */
  2852.     char ccbFill[144]; /*CCB memory allocated for driver  Login needs only 150 bytes BUT CCB really starts in the middle of AFPSCBPtr and also clobbers AFPAttnRoutine. */
  2853. }AFPLoginPrm;
  2854.  
  2855. æC 
  2856.  
  2857. æKY ASPOpenPrm
  2858. ASPOpenPrmPtr
  2859. æFc AppleTalk.h
  2860. æT struct
  2861. æD typedef struct {
  2862.     XPPPBHeader 
  2863.     short sessRefnum; /*Offset to session refnum */
  2864.     char aspTimeout; /*Timeout for ATP */
  2865.     char aspRetry; /*Retry count for ATP */
  2866.     AddrBlock serverAddr; /*Server address block */
  2867.     Ptr scbPointer; /*SCB pointer */
  2868.     Ptr attnRoutine; /*Attention routine pointer*/
  2869. }ASPOpenPrm;
  2870.  
  2871. typedef ASPOpenPrm *ASPOpenPrmPtr;
  2872.  
  2873. æC 
  2874.  
  2875. æKY ASPAbortPrm
  2876. æFc AppleTalk.h
  2877. æT struct
  2878. æD typedef struct {
  2879.     XPPPBHeader 
  2880.     Ptr abortSCBPtr; /*SCB pointer for AbortOS */
  2881. }ASPAbortPrm;
  2882.  
  2883. æC 
  2884.  
  2885. æKY ASPGetparmsBlk
  2886. æFc AppleTalk.h
  2887. æT struct
  2888. æD typedef struct {
  2889.     XPPPBHeader 
  2890.     short aspMaxCmdSize; /*For SPGetParms*/
  2891.     short aspQuantumSize;
  2892.     short numSesss;
  2893. }ASPGetparmsBlk;
  2894.  
  2895. æC 
  2896.  
  2897. æKY WDSElement
  2898. æFc AppleTalk.h
  2899. æT struct
  2900. æD typedef struct {
  2901.     short entryLength;
  2902.     Ptr entryPtr;
  2903. }WDSElement;
  2904.  
  2905. æC 
  2906.  
  2907. æKY NTElement
  2908. æFc AppleTalk.h
  2909. æT struct
  2910. æD typedef struct {
  2911.     AddrBlock nteAddress; /*network address of entity*/
  2912.     char filler;
  2913.     char entityData[99]; /*Object, Type & Zone*/
  2914. }NTElement;
  2915.  
  2916. æC 
  2917.  
  2918. æKY NamesTableEntry
  2919. æFc AppleTalk.h
  2920. æT struct
  2921. æD typedef struct {
  2922.     Ptr qNext; /*ptr to next NTE*/
  2923.     NTElement nt;
  2924. }NamesTableEntry;
  2925.  
  2926. æC 
  2927.  
  2928. æKY MPPATPHeader
  2929. æFc AppleTalk.h
  2930. æT struct
  2931. æD #define MPPATPHeader \
  2932.     QElem *qLink; /*next queue entry*/
  2933.     short qType; /*queue type*/
  2934.     short ioTrap; /*routine trap*/
  2935.     Ptr ioCmdAddr; /*routine address*/
  2936.     ProcPtr ioCompletion; /*completion routine*/
  2937.     OSErr ioResult; /*result code*/
  2938.     long userData; /*Command result (ATP user bytes)*/
  2939.     short reqTID; /*request transaction ID*/
  2940.     short ioRefNum; /*driver reference number*/
  2941.     short csCode; /*Call command code*/
  2942.  
  2943.  
  2944. æC 
  2945.  
  2946. æKY MPPparms
  2947. æFc AppleTalk.h
  2948. æT struct
  2949. æD typedef struct {
  2950.     MPPATPHeader 
  2951. }MPPparms;
  2952.  
  2953. æC 
  2954.  
  2955. æKY LAPparms
  2956. æFc AppleTalk.h
  2957. æT struct
  2958. æD typedef struct {
  2959.     MPPATPHeader 
  2960.     char protType; /*ALAP protocol Type */
  2961.     char filler;
  2962.     union {
  2963.     Ptr wdsPointer; /*-> write data structure*/
  2964.     Ptr handler; /*-> protocol handler routine*/
  2965.     } LAPptrs;
  2966. }LAPparms;
  2967.  
  2968. æC 
  2969.  
  2970. æKY DDPparms
  2971. æFc AppleTalk.h
  2972. æT struct
  2973. æD typedef struct {
  2974.     MPPATPHeader 
  2975.     char socket; /*socket number */
  2976.     char checksumFlag; /*check sum flag */
  2977.     union {
  2978.     Ptr wdsPointer; /*-> write data structure*/
  2979.     Ptr listener; /*->write data structure or -> Listener*/
  2980.     } DDPptrs;
  2981. }DDPparms;
  2982.  
  2983. æC 
  2984.  
  2985. æKY NBPparms
  2986. æFc AppleTalk.h
  2987. æT struct
  2988. æD typedef struct {
  2989.     MPPATPHeader 
  2990.     char interval; /*retry interval */
  2991.     char count; /*retry count */
  2992.     union {
  2993.     Ptr ntQElPtr;
  2994.     Ptr entityPtr;
  2995.     } NBPPtrs;
  2996.     union {
  2997.     char verifyFlag;
  2998.     struct {
  2999.     Ptr retBuffPtr;
  3000.     short retBuffSize;
  3001.     short maxToGet;
  3002.     short numGotten;
  3003.     } Lookup;
  3004.     struct {
  3005.     AddrBlock confirmAddr;
  3006.     char newSocket;
  3007.     } Confirm;
  3008.     } parm;
  3009. }NBPparms;
  3010.  
  3011. æC 
  3012.  
  3013. æKY SetSelfparms
  3014. æFc AppleTalk.h
  3015. æT struct
  3016. æD typedef struct {
  3017.     MPPATPHeader 
  3018.     char newSelfFlag; /*self-send toggle flag */
  3019.     char oldSelfFlag; /*previous self-send state */
  3020. }SetSelfparms;
  3021.  
  3022. æC 
  3023.  
  3024. æKY NBPKillparms
  3025. æFc AppleTalk.h
  3026. æT struct
  3027. æD typedef struct {
  3028.     MPPATPHeader 
  3029.     Ptr nKillQEl; /*ptr to i/o queue element to cancel */
  3030. }NBPKillparms;
  3031.  
  3032. æC 
  3033.  
  3034. æKY MPPParamBlock
  3035. MPPPBPtr
  3036. æFc AppleTalk.h
  3037. æT struct
  3038. æD typedef union {
  3039.     MPPparms MPP; /*General MPP parms*/
  3040.     LAPparms LAP; /*ALAP calls*/
  3041.     DDPparms DDP; /*DDP calls*/
  3042.     NBPparms NBP; /*NBP calls*/
  3043.     SetSelfparms SETSELF ;
  3044.     NBPKillparms NBPKILL ;
  3045. }MPPParamBlock;
  3046.  
  3047. typedef MPPParamBlock *MPPPBPtr;
  3048.  
  3049. æC 
  3050.  
  3051. æKY MOREATPHeader
  3052. æFc AppleTalk.h
  3053. æT struct
  3054. æD #define MOREATPHeader \
  3055.     char atpSocket; /*currbitmap for requests or ATP socket number*/
  3056.     char atpFlags; /*control information*/
  3057.     AddrBlock addrBlock; /*source/dest. socket address*/
  3058.     short reqLength; /*request/response length*/
  3059.     Ptr reqPointer; /*->request/response Data*/
  3060.     Ptr bdsPointer; /*->response BDS */
  3061.  
  3062.  
  3063. æC 
  3064.  
  3065. æKY ATPparms
  3066. æFc AppleTalk.h
  3067. æT struct
  3068. æD typedef struct {
  3069.     MPPATPHeader 
  3070.     MOREATPHeader 
  3071. }ATPparms;
  3072.  
  3073. æC 
  3074.  
  3075. æKY SendReqparms
  3076. æFc AppleTalk.h
  3077. æT struct
  3078. æD typedef struct {
  3079.     MPPATPHeader 
  3080.     MOREATPHeader 
  3081.     char filler; /*numOfBuffs */
  3082.     char timeOutVal; /*timeout interval */
  3083.     char numOfResps; /*number of responses actually received */
  3084.     char retryCount; /*number of retries */
  3085.     short intBuff; /*used internally for NSendRequest */
  3086. }SendReqparms;
  3087.  
  3088. æC 
  3089.  
  3090. æKY ATPmisc1
  3091. æFc AppleTalk.h
  3092. æT struct
  3093. æD typedef struct {
  3094.     MPPATPHeader 
  3095.     MOREATPHeader 
  3096.     union {
  3097.     char bitMap; /*bitmap received */
  3098.     char numOfBuffs; /*number of responses being sent*/
  3099.     char rspNum; /*sequence number*/
  3100.     } u0;
  3101. }ATPmisc1;
  3102.  
  3103. æC 
  3104.  
  3105. æKY ATPmisc2
  3106. æFc AppleTalk.h
  3107. æT struct
  3108. æD typedef struct {
  3109.     MPPATPHeader 
  3110.     MOREATPHeader 
  3111.     char filler;
  3112.     char bdsSize; /*number of BDS elements */
  3113.     short transID; /*transaction ID recd. */
  3114. }ATPmisc2;
  3115.  
  3116. æC 
  3117.  
  3118. æKY Killparms
  3119. æFc AppleTalk.h
  3120. æT struct
  3121. æD typedef struct {
  3122.     MPPATPHeader 
  3123.     MOREATPHeader 
  3124.     Ptr aKillQEl; /*ptr to i/o queue element to cancel*/
  3125. }Killparms;
  3126.  
  3127. æC 
  3128.  
  3129. æKY ATPParamBlock
  3130. ATPPBPtr
  3131. æFc AppleTalk.h
  3132. æT struct
  3133. æD typedef union {
  3134.     ATPparms ATP; /*General ATP parms*/
  3135.     SendReqparms SREQ; /*sendrequest parms*/
  3136.     ATPmisc1 OTH1; /*and a few others*/
  3137.     ATPmisc2 OTH2; /*and a few others*/
  3138.     Killparms KILL; /*and a few others */
  3139. }ATPParamBlock;
  3140.  
  3141. typedef ATPParamBlock *ATPPBPtr;
  3142.  
  3143. æC 
  3144.  
  3145. æKY XPPParamBlock
  3146. XPPParmBlkPtr
  3147. æFc AppleTalk.h
  3148. æT struct
  3149. æD typedef union {
  3150.     XPPPrmBlk XPP;
  3151.     ASPGetparmsBlk GETPARM;
  3152.     ASPAbortPrm ABORT;
  3153.     ASPOpenPrm OPEN;
  3154.     AFPLoginPrm LOGIN;
  3155. }XPPParamBlock;
  3156.  
  3157. typedef XPPParamBlock *XPPParmBlkPtr;
  3158.  
  3159. æC 
  3160.  
  3161. æKY OpenXPP
  3162. æFc AppleTalk.h
  3163. æT Function
  3164. æD pascal OSErr OpenXPP(short *xppRefnum); 
  3165. æDT OSErr myVariable = OpenXPP((short *) xppRefnum);
  3166. æRI  
  3167. æC 
  3168. »Opening the .XPP Driver
  3169.  
  3170. To open the .XPP driver, issue a Device Manager Open call.  (Refer to the Device
  3171. Manager chapter.)  The name of the .XPP driver is '.XPP'.  The original Macintosh
  3172. ROMs require that .XPP be opened only once. With new ROMs, the .XPP unit number can
  3173. always be obtained through an Open call.  With old ROMs only, the .XPP unit number
  3174. must be hard coded to XPPUnitNum (40) since only one Open call can be issued to the
  3175. driver.
  3176.  
  3177. The .XPP driver cannot be opened unless AppleTalk is open.  The application must
  3178. ensure that the .MPP and .ATP drivers are opened, as described earlier in this chapter.
  3179.  
  3180. The xppLoaded bit (bit 5) in the PortBUse byte in low memory indicates whether or not
  3181. the .XPP driver is open.
  3182.  
  3183. »Example
  3184.  
  3185. The following is an example of the procedure an application might use to open the
  3186. .XPP driver.
  3187.  
  3188. ;    Routine: OpenXPP
  3189. ;
  3190. ;        Open the .XPP driver and return the driver refNum for it.
  3191. ;
  3192. ;        Exit:    D0 = error code (ccr's set)
  3193. ;                 D1 = XPP driver refNum (if no errors)
  3194. ;
  3195. ;        All other registers preserved
  3196. ;
  3197. xppUnitNum    EQU    40                 ;default XPP driver number
  3198. xppTfRNum     EQU    -(xppUnitNum+1)    ;default XPP driver refNum
  3199.  
  3200. OpenXPP
  3201.     MOVE.L    A0-A1/D2,-(SP)            ;save registers
  3202.     MOVE      ROM85,D0                  ;check ROM type byte
  3203.     BPL.S     @10                       ;branch if >=128K ROMs
  3204.     BTST      #xppLoadedBit,PortBUse    ;is the XPP driver open already?
  3205.     BEQ.S     @10                       ;if not open, then branch to Open code
  3206.     MOVE      #xppTfRNum,D1             ;else use this as driver refnum
  3207.     MOVEQ     #0,D0                     ;set noErr
  3208.     BRA.S     @90                       ;and exit
  3209. ;
  3210. ; XPP driver not open. Make an _Open call to it. If using a 128K
  3211. ; ROM machine and the driver is already open, we will make another
  3212. ; Open call to it just so we get the correct driver refNum.
  3213. ;
  3214. @10 SUB       #ioQElSize,SP             ;allocate temporary param block
  3215.     MOVE.L    SP,A0                     ;A0 -> param block
  3216.     LEA       XPPName, A1               ;A1 -> XPP (ASP/AFP) driver name
  3217.     MOVE.L    A1,ioFileName(A0)         ;driver name into param block
  3218.     CLR.B     ioPermssn(A0)             ;clear permissions byte
  3219.     _Open
  3220.     MOVE      ioRefNum(A0),D1           ;D1=driver refNum (invalid if error)
  3221.     ADD       #ioQElSize,SP             ;deallocate temp param block
  3222. @90 MOVE.L    (SP)+,A0-A1/D2            ;restore registers
  3223.     TST       D0                        ;error? (set ccr's)
  3224.     RTS
  3225.     
  3226. XPPName  DC.B  4                        ;length of string
  3227.          DC.B  '.XPP'                   ;driver name
  3228.  
  3229. From Pascal, XPP can be opened through the OpenXPP call, which returns the driver’s
  3230. reference number:
  3231.  
  3232. FUNCTION OpenXPP (VAR xppRefnum: INTEGER) : OSErr;
  3233.  
  3234. »Open Errors
  3235.  
  3236. Errors returned when calling the Device Manager Open routine if the function does not
  3237. execute properly include the following:
  3238.  
  3239.   •  errors returned by System
  3240.   •  portInUse is returned if the AppleTalk port is in use by a driver
  3241.      other than AppleTalk or if AppleTalk is not open.
  3242.  
  3243. »Closing the .XPP Driver
  3244.  
  3245. To close the .XPP driver, call the Device Manager Close routine.
  3246.  
  3247. Warning:  There is generally no reason to close the driver.  Use this
  3248.           call sparingly, if at all.  This call should generally be used
  3249.           only by system-level applications.
  3250.  
  3251. »Close Errors
  3252.  
  3253. Errors returned when calling the Device Manager Close routine if the function does
  3254. not execute properly include the following:
  3255.  
  3256.   •  errors returned by System
  3257.   •  closeErr (new ROMs only) is returned if you try to close the driver
  3258.      and there are sessions active through that driver.  When sessions are
  3259.      active, closeErr is returned and the driver remains open.
  3260.   •  on old ROMs the driver is closed whether or not sessions are active
  3261.      and no error is returned. Results are unpredictable if sessions are
  3262.      still active.
  3263.  
  3264. »Session Control Block
  3265.  
  3266. The session control block (SCB) is a nonrelocatable block of data passed by the
  3267. caller to XPP upon session opening. XPP reserves this block for use in maintaining an
  3268. open session.   The SCB size is defined by the constant scbMemSize.  The SCB is a
  3269. locked block, and as long as the session is open, the SCB cannot be modified in any
  3270. way by the application.  There is one SCB for each open session. This block can be
  3271. reused once a CloseSess call is issued and completed for that session or when the
  3272. session is indicated as closed.
  3273.     
  3274.  
  3275. æKY ASPOpenSession
  3276. æFc AppleTalk.h
  3277. æT Function
  3278. æD pascal OSErr ASPOpenSession(ASPOpenPrmPtr thePBptr,Boolean async); 
  3279. æDT OSErr myVariable = ASPOpenSession((ASPOpenPrmPtr) thePBptr,(Boolean) async);
  3280. æRI V-536
  3281. æC 
  3282. »AppleTalk Session Protocol Functions
  3283.  
  3284. This section contains descriptions of the .XPP driver functions that you can call. 
  3285. Each function description shows the required parameter block fields, their offsets
  3286. within the parameter block and a brief definition of the field.  Possible result
  3287. codes are also described.
  3288.  
  3289. »Note on Result Codes
  3290.  
  3291. An important distinction exists between the aspParamErr and aspSessClose  result
  3292. codes that may be returned by the .XPP driver.
  3293.  
  3294. When the driver returns aspParamErr to a call that takes as an input a session reference
  3295. number, the session reference number does not relate to a valid open session.  There
  3296. could be several reasons for this, such as the workstation or server end closed the
  3297. session or the server end of the session died.
  3298.  
  3299. The aspSessClosed result code indicates that even though the session reference number
  3300. relates to a valid session, that particular session is in the process of closing down
  3301. (although  the session is not yet closed).
  3302.  
  3303. FUNCTION ASPOpenSession (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr;
  3304.  
  3305. Parameter block
  3306.   -->    26    csCode       word       Always ASPOpenSess
  3307.   -->    28    sessRefnum   word       Session reference number
  3308.   -->    30    aspTimeout   byte       Retry interval in seconds
  3309.   -->    31    aspRetry     byte       Number of retries
  3310.   -->    32    serverAddr   long word  Server socket address
  3311.   -->    36    scbPointer   pointer    Pointer to session control block
  3312.   -->    40    attnRoutine  pointer    Pointer to attention routine
  3313.  
  3314. ASPOpenSession initiates (opens) a session between the workstation and a server.  The
  3315. required parameter block is shown above.  A brief definition of the fields follows.
  3316.  
  3317. SessRefnum is a unique number identifying the open session between the workstation
  3318. and the server.  The SessRefnum is returned when the function completes successfully
  3319. and is used in all calls to identify the session.
  3320.  
  3321. ASPTimeOut is the interval in seconds between retries of the open session request.
  3322.  
  3323. ASPRetry is the number of retries that will be attempted.
  3324.  
  3325. ServerAddr is the network identifier or address of the socket on which the server is
  3326. listening.
  3327.  
  3328. SCBPointer points to a nonrelocatable block of data for the session control block
  3329. (SCB) that the .XPP driver reserves for use in maintaining an open session.   The SCB
  3330. size is defined by the constant scbMemSize.  The SCB is a locked block and as long as
  3331. the session is open, the SCB cannot be modified in any way by the application.  There
  3332. is one SCB for each open session.  This block can be reused when a CloseSess call is
  3333. issued and completed for that session, or when the session is indicated as closed
  3334. through return of aspParamErr as the result of a call for that session.
  3335.  
  3336. AttnRoutine is a pointer to a routine that is invoked if an attention from the server
  3337. is received, or upon session closing.  If this pointer is equal to zero, no attention
  3338. routine will be invoked.
  3339.  
  3340. Result codes    aspNoMoreSess    Driver cannot support another session
  3341.                 aspParamErr      Server returned bad (positive) error code    
  3342.                 aspNoServers     No servers at that address, or the server
  3343.                                  did not respond to the request
  3344.                 reqAborted       OpenSess was aborted by an AbortOS
  3345.                 aspBadVersNum    Server cannot support the offered 
  3346.                                  version number
  3347.                 aspServerBusy    Server cannot open another session
  3348.  
  3349. Note: The number of sessions that the driver is capable of supporting
  3350.       depends on the machine that the driver is running on. 
  3351.  
  3352. æKY ASPCloseSession
  3353. æFc AppleTalk.h
  3354. æT Function
  3355. æD pascal OSErr ASPCloseSession(XPPParmBlkPtr thePBptr,Boolean async); 
  3356. æDT OSErr myVariable = ASPCloseSession((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3357. æRI V-537
  3358. æC  
  3359. Parameter block
  3360.   -->    26    csCode      word  Always ASPCloseSession
  3361.   -->    28    sessRefnum  word  Session reference number
  3362.  
  3363. ASPCloseSession closes the session identified by the sessRefnum returned in the
  3364. ASPOpenSession call.  ASPCloseSession aborts any calls that are active on the session,
  3365. closes the session, and calls the attention routine, if any, with an attention code
  3366. of zero (zero is invalid as a real attention code).
  3367.  
  3368. Result codes    aspParamErr      Parameter error, indicates an invalid
  3369.                                  session reference number
  3370.                 aspSessClosed    Session already in process of closing
  3371.  
  3372. æKY ASPAbortOS
  3373. æFc AppleTalk.h
  3374. æT Function
  3375. æD pascal OSErr ASPAbortOS(XPPParmBlkPtr thePBptr,Boolean async); 
  3376. æDT OSErr myVariable = ASPAbortOS((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3377. æRI V-537
  3378. æC  
  3379. Parameter block
  3380.   -->    26    csCode            word     Always ASPAbortOS
  3381.   -->    28    abortSCBPointer   pointer  Pointer to session control block
  3382.  
  3383. ASPAbortOS aborts a pending (not yet completed) ASPOpenSession call.  The aborted
  3384. ASPOpenSession call will return a reqAborted error.
  3385.  
  3386. AbortSCBPointer points to the original SCB used in the the pending ASPOpenSession
  3387. call.
  3388.  
  3389. Result codes    cbNotFound    SCB not found, no outstanding open session
  3390.                               to be aborted.
  3391.                               Pointer did not point to an open session SCB.
  3392.  
  3393. æKY ASPGetParms
  3394. æFc AppleTalk.h
  3395. æT Function
  3396. æD pascal OSErr ASPGetParms(XPPParmBlkPtr thePBptr,Boolean async); 
  3397. æDT OSErr myVariable = ASPGetParms((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3398. æRI V-538
  3399. æC  
  3400. Parameter block
  3401.   -->    26    csCode          word  Always ASPGetParms
  3402.   -->    28    aspMaxCmdSize   word  Maximum size of command block
  3403.   -->    30    aspQuantumSize  word  Maximum data size
  3404.   -->    32    numSesss        word  Number of sessions
  3405.  
  3406. ASPGetParms returns three ASP parameters.  This call does not require an open session.
  3407.  
  3408. ASPMaxCmdSize is the maximum size of a command that can be sent to the server.
  3409.  
  3410. ASPQuantumSize is the maximum size of data that can be transferred to the server in a
  3411. Write request or from the server in a command reply.
  3412.  
  3413. NumSess is the number of concurrent sessions supported by the driver.
  3414.  
  3415. æKY ASPCloseAll
  3416. æFc AppleTalk.h
  3417. æT Function
  3418. æD pascal OSErr ASPCloseAll(XPPParmBlkPtr thePBptr,Boolean async); 
  3419. æDT OSErr myVariable = ASPCloseAll((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3420. æRI V-538
  3421. æC  
  3422. Parameter block
  3423.   -->    26    csCode  word  Always ASPCloseAll
  3424.  
  3425. ASPCloseAll closes every session that the driver has active, aborting all active
  3426. requests and invoking the attention routines where provided.  This call should be
  3427. used carefully.  ASPCloseAll can be used as a system level resource for making sure
  3428. all sessions are closed prior to closing the driver.
  3429.  
  3430. æKY ASPUserWrite
  3431. æFc AppleTalk.h
  3432. æT Function
  3433. æD pascal OSErr ASPUserWrite(XPPParmBlkPtr thePBptr,Boolean async); 
  3434. æDT OSErr myVariable = ASPUserWrite((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3435. æRI V-538
  3436. æC  
  3437. Parameter block
  3438.   -->    18    cmdResult   long word  ASP command result
  3439.   -->    26    csCode      word       Always UserWrite
  3440.   -->    28    sessRefnum  word       Session reference number
  3441.   -->    30    aspTimeout  byte       Retry interval in seconds
  3442.   -->    32    cbSize      word       Command block size
  3443.   -->    34    cbPtr       pointer    Command block pointer
  3444.   <->    38    rbSize      word       Reply buffer size and reply size
  3445.   -->    40    rbPtr       pointer    Reply buffer pointer
  3446.   <->    44    wdSize      word       Write data size
  3447.   -->    46    wdPtr       pointer    Write data pointer
  3448.   -->    50    ccbStart    record     Start of memory for CCB
  3449.  
  3450. ASPUserWrite transfers data on a session.  ASPUserWrite is one of the two main calls
  3451. that can be used to transfer data on an ASP session.  The other call that performs a
  3452. similar data transfer  is ASPUserCommand described below.  The ASPUserWrite command
  3453. returns data in two different places.  Four bytes of data are returned in the cmdResult
  3454. field and a variable size reply buffer is also returned.
  3455.  
  3456. CmdResult is four bytes of data returned by the server.
  3457.  
  3458. SessRefnum is the session reference number returned in the ASPOpenSession call.
  3459.  
  3460. ASPTimeOut is the interval in seconds between retries of the call.  Notice that there
  3461. is no aspRetry field (retries are infinite).  The command will be retried at the
  3462. prescribed interval until completion or the session is closed.
  3463.  
  3464. CBSize is the size in bytes of the command data that is to be written on the session.
  3465.  The size of the command block must not exceed the value of aspMaxCmdSize returned by
  3466. the ASPGetParms call. Note that this buffer is not the data to be written by the
  3467. command but only the data of the command itself.
  3468.  
  3469. CBPtr points to the command data.
  3470.  
  3471. RBSize is passed and indicates the size of the reply buffer in bytes expected by the
  3472. command.  RBSize is also returned and indicates the size of the reply that was actually
  3473. returned.
  3474.  
  3475. RBPtr points to the reply buffer.
  3476.  
  3477. WDSize is passed and indicates the size of the write data in bytes to be sent by the
  3478. command.  WDSize is also returned and indicates the size of the write data that was
  3479. actually written.
  3480.  
  3481. WDPointer points to the write data buffer.
  3482.  
  3483. CCBStart is the start of the memory to be used by the .XPP driver for the command
  3484. control block.  The size of this block is equal to a maximum of 296 bytes.  To determine
  3485. the exact requirement, refer to the CCB Sizes section of this document.
  3486.  
  3487. Result codes     aspParamErr       Invalid session number, session has
  3488.                                    been closed
  3489.                  aspSizeErr        Command block size is bigger than MaxCmdSize
  3490.                  aspSessClosed     Session is closing
  3491.                  aspBufTooSmall    Reply is bigger than response buffer;
  3492.                                    the buffer will be filled, data will
  3493.                                    be truncated
  3494.  
  3495. æKY ASPUserCommand
  3496. æFc AppleTalk.h
  3497. æT Function
  3498. æD pascal OSErr ASPUserCommand(XPPParmBlkPtr thePBptr,Boolean async); 
  3499. æDT OSErr myVariable = ASPUserCommand((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3500. æRI V-539
  3501. æC  
  3502. Parameter block
  3503.   -->    18    cmdResult   long word  ASP command result
  3504.   -->    26    csCode      word       Always ASPUserCommand
  3505.   -->    28    sessRefnum  word       Session number
  3506.   -->    30    aspTimeout  byte       Retry interval in seconds
  3507.   -->    32    cbSize      word       Command block size
  3508.   -->    34    cbPtr       pointer    Command block pointer
  3509.   <->    38    rbSize      word       Reply buffer and reply size
  3510.   -->    40    rbPtr       pointer    Reply buffer pointer
  3511.   -->    50    ccbStart    record     Start of memory for CCB
  3512.  
  3513. ASPUserCommand is used to send a command to the server on a session.
  3514.  
  3515. SessRefnum is the session reference number returned in the ASPOpenSession call.
  3516.  
  3517. ASPTimeOut is the interval in seconds between retries of the call.  Notice that there
  3518. is no aspRetry field (retries are infinite).  The command will be retried at the
  3519. prescribed interval until completion or the session is closed.
  3520.  
  3521. CBSize is the size in bytes of the block of data that contains the command to be sent
  3522. to the server on the session.  The size of the command block must not exceed the
  3523. value of aspMaxCmdSize returned by the ASPGetParms call.
  3524.  
  3525. CBPointer points to the block of data containing the command that is to be sent to
  3526. the server on the session.
  3527.  
  3528. RBSize is passed and indicates the size of the reply buffer in bytes expected by the
  3529. command.  RBSize is also returned and indicates the size of the reply that was actually
  3530. returned.
  3531.  
  3532. RBPtr points to the reply buffer.
  3533.  
  3534. CCBStart is the start of the memory to be used by the .XPP driver for the command
  3535. control block.  The size of this block is equal to a maximum of 150 bytes.  To determine
  3536. the exact requirement refer to the CCB Sizes section of this document.
  3537.  
  3538. Result codes     aspParamErr       Invalid session number, session has
  3539.                                    been closed
  3540.                  aspSizeErr        Command block size is bigger than MaxCmdSize
  3541.                  aspSessClosed     Session is closing
  3542.                  aspBufTooSmall    Reply is bigger than response buffer;
  3543.                                    the buffer will be filled, data will
  3544.                                    be truncated
  3545.  
  3546. æKY ASPGetStatus
  3547. æFc AppleTalk.h
  3548. æT Function
  3549. æD pascal OSErr ASPGetStatus(XPPParmBlkPtr thePBptr,Boolean async); 
  3550. æDT OSErr myVariable = ASPGetStatus((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3551. æRI V-540
  3552. æC  
  3553. Parameter block
  3554.   -->    26    csCode      word       Always ASPGetStatus
  3555.   -->    30    aspTimeout  byte       Retry interval in seconds
  3556.   -->    31    aspRetry    byte       Number of retries
  3557.   -->    32    serverAddr  long word  Server socket address
  3558.   <->    38    rbSize      word       Reply buffer and reply size
  3559.   -->    40    rbPtr       pointer    Reply buffer pointer
  3560.   -->    50    ccbStart    record     Start of memory for CCB
  3561.  
  3562. ASPGetStatus returns server status.  This call is also used as GetServerInfo at the
  3563. AFP level. This call is unique in that it transfers data over the network without
  3564. having a session open.  This call does not pass any data but requests that server
  3565. status be returned.
  3566.  
  3567. ASPTimeOut is the interval in seconds between retries of the call.
  3568.  
  3569. ASPRetry is the number of retries that will be attempted.
  3570.  
  3571. ServerAddr is the network identifier or address of the socket on which the server is
  3572. listening.
  3573.  
  3574. RBSize is passed and indicates the size of the reply buffer in bytes expected by the
  3575. command. RBSize is also returned and indicates the size of the reply that was actually
  3576. returned.
  3577.  
  3578. RBPtr points to the reply buffer.
  3579.  
  3580. CCBStart is the start of the memory to be used by the .XPP driver for the command
  3581. control block.  The size of this block is equal to a maximum of 150 bytes.  To determine
  3582. the exact requirement refer to the CCB Sizes section of this document.
  3583.  
  3584. Result codes    aspBufTooSmall    Reply is bigger than response buffer,
  3585.                                   or Replysize is bigger than ReplyBuffsize
  3586.                 aspNoServer       No response from server at address used
  3587.                                   in call
  3588.  
  3589. æKY AFPCommand
  3590. æFc AppleTalk.h
  3591. æT Function
  3592. æD pascal OSErr AFPCommand(XPPParmBlkPtr thePBptr,Boolean async); 
  3593. æDT OSErr myVariable = AFPCommand((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3594. æRI V-542
  3595. æC 
  3596. »AFPCall Function
  3597.  
  3598. The AFPCall function can have one of the following command formats.
  3599.  
  3600.   •  General
  3601.   •  Login
  3602.   •  AFPWrite
  3603.   •  AFPRead
  3604.  
  3605. »General Command Format
  3606.  
  3607. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr;
  3608.  
  3609. Parameter block
  3610.   -->    18    cmdResult   long word  AFP command result
  3611.   -->    26    csCode      word       Always AFPCall
  3612.   -->    28    sessRefnum  word       Session reference number
  3613.   -->    30    aspTimeout  byte       Retry interval in seconds
  3614.   -->    32    cbSize      word       Command buffer size
  3615.   -->    34    cbPtr       pointer    Command buffer
  3616.   <->    38    rbSize      word       Reply buffer size and reply size
  3617.   -->    40    rbPtr       pointer    Reply buffer pointer
  3618.   <->    44    wdSize      word       Write data size
  3619.   -->    46    wdPtr       pointer    Write data pointer
  3620.   -->    50    ccbStart    record     Start of memory for CCB
  3621.  
  3622. The general command format for the AFPCall function passes an AFP command to the
  3623. server.  This format is used for all AFP calls except AFPLogin, AFPRead, and AFPWrite.
  3624.   Note that from Pascal this call is referred to as AFPCommand.
  3625.  
  3626. CmdResult is four bytes of data returned from the server containing an indication of
  3627. the result of the AFP command.
  3628.  
  3629. SessRefnum is the session reference number returned in the AFPLogin call.
  3630.  
  3631. ASPTimeOut is the interval in seconds between retries of the call by the driver.
  3632.  
  3633. CBSize is the size in bytes of the block of data that contains the command to be sent
  3634. to the server on the session. The size of the command block must not exceed the value
  3635. of aspMaxCmdSize returned by the ASPGetParms call.
  3636.  
  3637. CBPtr points to start of the block of data (command block) containing the command
  3638. that is to be sent to the server on the session.  The first byte of the command block
  3639. must contain the AFP command byte.  Subsequent bytes in the command buffer contain
  3640. the  parameters associated with the command as defined in the AFP document.
  3641.  
  3642. RBSize is passed and indicates the size of the reply buffer in bytes expected by the
  3643. command. RBSize is also returned and indicates the size of the reply that was actually
  3644. returned.
  3645.  
  3646. RBPtr points to the reply buffer.
  3647.  
  3648. WDSize is the size of data to be written to the server (only used if the command is
  3649. one that is mapped to an ASPUserWrite).
  3650.  
  3651. WDPtr points to the write data buffer (only used if the command is one that is mapped
  3652. to an ASPUserWrite).
  3653.  
  3654. CCBStart is the start of the memory to be used by the .XPP driver for the command
  3655. control block.  The size of this block is equal to a maximum of 296 bytes.  To determine
  3656. the exact requirement refer to the CCB Sizes section of this document.
  3657.  
  3658. Result codes    aspParamErr       Invalid session number; session has
  3659.                                   been closed
  3660.                 aspSizeErr        Command block size is bigger than MaxCmdSize
  3661.                 aspSessClosed     Session is closing
  3662.                 aspBufTooSmall    Reply is bigger than response buffer or
  3663.                                   buffer will be filled, data will be truncated
  3664.                 afpParmError      AFP command block size is equal to zero.
  3665.                                   This error will also be returned if the
  3666.                                   command byte in the command block is equal
  3667.                                   to 0 or $FF (255) or GetSrvrStatus (15).
  3668.  
  3669. »Login Command Format
  3670.  
  3671. The AFP login command executes a series of AFP operations as defined in the AFP Draft
  3672. Proposal.  For further information, refer to the AFP document.
  3673.  
  3674. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  3675.  
  3676. Parameter block
  3677.   -->    18    cmdResult       long word  AFP command result
  3678.   -->    26    csCode          word       Always AFPCall
  3679.   -->    28    sessRefnum      word       Session reference number
  3680.   -->    30    aspTimeout      byte       Retry interval in seconds
  3681.   -->    31    aspRetry        byte       Number of retries
  3682.   -->    32    cbSize          word       Command buffer size
  3683.   -->    34    cbPtr           pointer    Command buffer
  3684.   <->    38    rbSize          word       Reply buffer size and reply size
  3685.   -->    40    rbPtr           pointer    Reply buffer pointer
  3686.   -->    44    afpAddrBlock    long word  Server address block
  3687.   <->    48    afpSCBPtr       pointer    SCB pointer
  3688.   <->    52    afpAttnRoutine  pointer    Attention routine pointer
  3689.   -->    50    ccbStart        record     Start of command control block
  3690.  
  3691. CmdResult is four bytes of data returned from the server containing an indication of
  3692. the result of the AFP command.
  3693.  
  3694. SessRefnum is the session reference number (returned by the AFPLogin call).
  3695.  
  3696. ASPTimeOut is the interval in seconds between retries of the call.
  3697.  
  3698. ASPRetry is the number of retries that will be attempted.
  3699.  
  3700. CBSize is the size in bytes of the block data that contains the command to be sent to
  3701. the server on the session. The size of the command block must not exceed the value of
  3702. aspMaxCmdSize returned by the ASPGetParms call.
  3703.  
  3704. CBPtr points to the block of data (command block) containing the AFP login command
  3705. that is to be sent to the server on the session.  The first byte of the command block
  3706. must be the AFP login command byte.  Subsequent bytes in the command buffer contain
  3707. the parameters associated with the command.
  3708.  
  3709. RBSize is passed and indicates the size of the reply buffer in bytes expected by the
  3710. command.  RBSize is also returned and indicates the size of the reply that was actually
  3711. returned.
  3712.  
  3713. RBPtr points to the reply buffer.
  3714.  
  3715. AFPServerAddr is the network identifier or address of the socket on which the server
  3716. is listening.
  3717.  
  3718. AFPSCBPointer points to a locked block of data for the session control block
  3719. (SCB). The SCB size is defined by scbMemSize.  The SCB is a locked block, and as long
  3720. as the session is open, the SCB cannot be modified in any way by the application. 
  3721. There is one SCB for each open session.
  3722.  
  3723. AFPAttnRoutine is a pointer to a routine that is invoked if an attention from the
  3724. server is received.  When afpAttnRoutine is equal to zero, no attention routine will
  3725. be invoked.
  3726.  
  3727. CCBStart is the start of the memory to be used by the .XPP driver for the command
  3728. control block.  The size of this block is equal to a maximum of 150 bytes.  To determine
  3729. the exact requirement refer to the CCB Sizes section later in this chapter.
  3730.  
  3731. Note:  In the parameter block, the afpSCBPointer and the afpAttnRoutine
  3732.        fields overlap with the start of the CCB and are modified by the call.
  3733.  
  3734. Result codes    aspSizeErr        Command block size is bigger than MaxCmdSize
  3735.                 aspBufTooSmall    Reply is bigger than response buffer or
  3736.                                   buffer will be filled, data will be truncated
  3737.                 aspNoServer       Server not responding
  3738.                 aspServerBusy     Server cannot open another session
  3739.                 aspBadVersNum     Server cannot support the offered ASP
  3740.                                   version number
  3741.                 aspNoMoreSess     Driver cannot support another session.
  3742.  
  3743.  
  3744. »AFPWrite Command Format
  3745.  
  3746. The AFPWrite and AFPRead command formats allow the calling application to make AFP-level
  3747. calls that read or write a data block that is larger than a single ASP-level call is
  3748. capable of reading or writing.  The maximum number of bytes of data that can be read
  3749. or written at the ASP level is equal to quantumSize.
  3750.  
  3751. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr;
  3752.  
  3753. Parameter block
  3754.   -->    18    cmdResult   long word  AFP command result
  3755.   -->    26    csCode      word       Always AFPCall
  3756.   -->    28    sessRefnum  word       Session number
  3757.   -->    30    aspTimeout  byte       Retry interval in seconds
  3758.   -->    32    cbSize      word       Command buffer size
  3759.   -->    34    cbPtr       pointer    Command buffer
  3760.   <->    38    rbSize      word       Reply buffer size and reply size
  3761.   -->    40    rbPtr       pointer    Reply buffer pointer
  3762.   -->    44    wdSize      word       (used internally)
  3763.   <->    46    wdPtr       pointer    Write data pointer  (updated)
  3764.   -->    50    ccbStart    record     Start of memory for CCB
  3765.  
  3766. CmdResult is four bytes of data returned from the server containing an indication of
  3767. the result of the AFP command.
  3768.  
  3769. SessRefnum is the session reference number returned in the AFPLogin call.
  3770.  
  3771. ASPTimeOut is the interval in seconds between retries of the call.
  3772.  
  3773. CBSize is the size in bytes of the block data that contains the command to be sent to
  3774. the server on the session.  The size of the command block must not exceed the value
  3775. of aspMaxCmdSize returned by the aspGetParms call.
  3776.  
  3777. CBPtr points to the block of data (see command block structure below) containing the
  3778. AFP write command that is to be sent to the server on the session.  The first byte of
  3779. the Command Block must contain the AFP write command byte.
  3780.  
  3781. RBSize is passed and indicates the size of the reply buffer in bytes expected by the
  3782. command.  RBSize is also returned and indicates the size of the reply that was actually
  3783. returned.
  3784.  
  3785. RBPtr points to the reply buffer.
  3786.  
  3787. WDSize is used internally.
  3788.  
  3789. Note:  This command does not pass the write data size in the queue element
  3790.        but in the command buffer.  XPP will look for the size in that buffer.
  3791.  
  3792. WDPtr is a pointer to the block of data to be written.  Note that this field will be
  3793. updated by XPP as it proceeds and will always point to that section of the data which
  3794. XPP is currently writing.
  3795.  
  3796. CCBStart is the start of the memory to be used by the XPP driver for the command
  3797. control block.  The size of this block is equal to a maximum of 296 bytes.  To determine
  3798. the exact requirement refer to the CCB Sizes section later in this chapter.
  3799.  
  3800. Command Block Structure:  The AFP write command passes several arguments to XPP in
  3801. the command buffer itself. The byte offsets are relative to the location pointed to
  3802. by cbPtr.
  3803.  
  3804.   -->    0    cmdByte       byte       AFP call command byte
  3805.   -->    1    startEndFlag  byte       Start/end Flag
  3806.   <->    4    rwOffset      long word  Offset within fork to write
  3807.   <->    8    reqCount      long word  Requested count
  3808.  
  3809. CmdByte is the AFP call command byte and must contain the AFP write command code.
  3810.  
  3811. StartEndFlag is a one-bit flag (the high bit of the byte) indicating whether the
  3812. rwOffset field is relative to the beginning or the end of the fork (all other bits
  3813. are zero).
  3814.  
  3815.   0 = relative to the beginning of the fork
  3816.   1 = relative to the end of the fork
  3817.  
  3818. RWOffset is the byte offset within the fork at which the write is to begin.
  3819.  
  3820. ReqCount indicates the size of the data to be written and is returned as the actual
  3821. size written.
  3822.  
  3823. The rwOffset and reqCount fields are modified by XPP as the write proceeds and will
  3824. always indicate the current value of these fields.
  3825.  
  3826. The Pascal structure of the AFP command buffer follows:
  3827.  
  3828. AFPCommandBlock = PACKED RECORD
  3829.                     cmdByte:       Byte;
  3830.                     startEndFlag:  Byte;
  3831.                     forkRefNum:    INTEGER;    {used by server}
  3832.                     rwOffset:      LONGINT;
  3833.                     reqCount:      LONGINT;
  3834.                     newLineFlag:   Byte;       {unused by write}
  3835.                     newLineChar:   CHAR;       {unused by write}
  3836.                   END;
  3837.  
  3838. Result codes    aspParamErr       Invalid session number
  3839.                 aspSizeErr        Command block size is bigger than MaxCmdSize
  3840.                 aspSessClosed     Session is closing
  3841.                 aspBufTooSmall    Reply is bigger than response buffer
  3842.  
  3843. »AFPRead Command Format
  3844.  
  3845. The AFPWrite and AFPRead command formats allow the calling application to make AFP-level
  3846. calls that read or write a data block that is larger than a single ASP-level call is
  3847. capable of reading or writing.  The maximum number of bytes of data that can be read
  3848. or written at the ASP level is equal to quantumSize.
  3849.  
  3850. FUNCTION AFPCommand (xParamBlock: XPPParmBlkPtr; async: BOOLEAN) : OSErr;
  3851.  
  3852. Parameter block
  3853.   -->    18    cmdResult   long word  ASP command result
  3854.   -->    26    csCode      word       Always AFPCall
  3855.   -->    28    sessRefnum  word       Session number
  3856.   -->    30    aspTimeout  byte       Retry interval in seconds
  3857.   -->    32    cbSize      word       Command buffer size
  3858.   -->    34    cbPtr       pointer    Command buffer
  3859.   -->    38    rbSize      word       Used internally
  3860.   <->    40    rbPtr       pointer    Reply buffer pointer (updated)
  3861.   -->    50    ccbStart    record     Start of memory for CCB
  3862.  
  3863. CmdResult is four bytes of data returned from the server containing an indication of
  3864. the result of the AFP command.
  3865.  
  3866. SessRefnum is the session reference number returned in the AFPLogin  call.
  3867.  
  3868. ASPTimeOut is the interval in seconds between retries of the call.
  3869.  
  3870. CBSize is the size in bytes of the block data that contains the command to be sent to
  3871. the server on the session.  The size of the command block must not exceed the value
  3872. of aspMaxCmdSize returned by the GetParms call.
  3873.  
  3874. CBPtr points to the block of data (command block) containing the AFP read command
  3875. that is to be sent to the server on the session.  The first byte of the command block
  3876. must contain the AFP read command byte.  The command block structure is shown below.
  3877.  
  3878. RBSize  is used internally.
  3879.  
  3880. Note:  This command does not pass the read size in the queue element but
  3881.        in the command buffer.  XPP will look for the size in that buffer.
  3882.  
  3883. RBPtr points to the reply buffer.  Note that this field will be updated by XPP as it
  3884. proceeds and will always point to that section of the buffer that XPP is currently
  3885. reading into.
  3886.  
  3887. CCBStart is the start of the memory to be used by the .XPP driver for the command
  3888. control block.  The size of this block is equal to a maximum of 150 bytes.  To determine
  3889. the exact requirement refer to The CCB Sizes section later in this chapter.
  3890.  
  3891. Command Block Structure:  The AFP read command passes several arguments to XPP in the
  3892. command buffer itself. The byte offsets are relative to the location pointed to by
  3893. cbPointer.
  3894.  
  3895.   -->    0    cmdByte      byte       AFP call command byte
  3896.   <->    4    rwOffset     long word  Offset within fork to read
  3897.   <->    8    reqCount     long word  Requested count
  3898.   -->    12   newLineFlag  byte       Newline Flag
  3899.   -->    13   newLineChar  byte       Newline Character
  3900.  
  3901. CmdByte is the AFP call command byte and must contain the AFP read command code.
  3902.  
  3903. RWOffset is the byte offset within the fork at which the read is to begin.
  3904.  
  3905. ReqCount  indicates the size of the read data buffer and is returned as the actual
  3906. size read.
  3907.  
  3908. The rwOffset and reqCount fields are modified by XPP as the read proceeds and will
  3909. always indicate the current value of these fields.
  3910.  
  3911. NewLineFlag is a one-bit flag (the high bit of the byte) indicating whether or not
  3912. the read is to terminate at a specified character (all other bits are zero).
  3913.  
  3914.   0 = no Newline Character is specified
  3915.   1 = a Newline Character is specified
  3916.  
  3917. NewLineChar is any character from $00 to $FF (inclusive) that, when encountered in
  3918. reading the fork, causes the read operation to terminate.
  3919.  
  3920. The Pascal structure of the AFPCommand follows:
  3921.  
  3922. AFPCommandBlock = PACKED RECORD
  3923.                     cmdByte:       Byte;
  3924.                     startEndFlag:  Byte;     {unused for read}
  3925.                     forkRefNum:    INTEGER;  {used by server}
  3926.                     rwOffset:      LONGINT;
  3927.                     reqCount:      LONGINT;
  3928.                     newLineFlag:   Byte;
  3929.                     newLineChar:   CHAR;
  3930.                   END;
  3931.  
  3932. Result codes    aspParamErr       Invalid session number
  3933.                 aspSizeErr        Command block size is bigger than MaxCmdSize
  3934.                 aspSessClosed     Session is closing
  3935.                 aspBufTooSmall    Reply is bigger than response buffer
  3936.         
  3937.  
  3938. æKY GetLocalZones
  3939. æFc AppleTalk.h
  3940. æT Function
  3941. æD 
  3942. pascal OSErr GetLocalZones(XPPParmBlkPtr thePBptr,Boolean async); 
  3943. æDT OSErr myVariable = GetLocalZones((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3944. æRI VI
  3945. æC 
  3946. Parameter block
  3947.   ¨  16  ioResult  word  result code 
  3948.   Æ  26  csCode  word  routine selector; always xCall
  3949.   Æ  28  xppSubCode  word  routine selector; getLocalZones
  3950.   Æ  30  xppTimeOut  byte  retry interval in seconds
  3951.   Æ  31  xppRetry  byte  retry count
  3952.   Æ  34  zipBuffPtr  pointer  pointer to data buffer
  3953.   ¨  38  zipNumZones  word  number of names returned
  3954.   ¨  40  zipLastFlag  byte  nonzero if no more names
  3955.   Æ  42  zipInfoField  70 bytes  for use by ZIP; first word set to 0
  3956.  
  3957. The GetLocalZones function returns a list of all the zone names on the local
  3958. network; that is, the network that includes the node on which your application
  3959. is running.
  3960.  
  3961. The ioResult parameter returns the result of the function; if you call the
  3962. function asynchronously, the function sets this field to 1 as soon as it begins
  3963. execution, and changes the field to the actual result code when it completes
  3964. execution. The csCode and xppSubCode parameters are routine selectors and are
  3965. automatically set by the MPW interface to xCall and getLocalZones for this
  3966. function. The xppTimeOut field specifies the amount of time, in seconds, that
  3967. the .ATP driver should wait between attempts to obtain the data. A value of 3 or
  3968. 4 for the xppTimeOut field generally gives good results. The xppRetry field
  3969. specifies the number of times the .ATP driver should attempt to obtain the data
  3970. before returning the ReqFailed (request failed) result code. A value of 3 or 4
  3971. for the xppRetry field usually works well.
  3972.  
  3973. The zipBuffPtr is a pointer to a 578-byte data buffer that you must allocate.
  3974. The Zone Information Protocol returns the zone names into this buffer as a
  3975. packed array of packed Pascal strings. The zipNumZones parameter returns the
  3976. number of zone names that ZIP placed in the data buffer. 
  3977.  
  3978. The .XPP driver sets the zipLastFlag field to 1 if there are no more zone names
  3979. for your network. If the zipLastFlag field is still 0 when the GetLocalZones
  3980. function has completed execution, you must empty the data buffer pointed to by
  3981. the zipBuffPtr parameter and immediately call the GetLocalZones function again
  3982. without changing the value in the zipInfoField parameter. The zipInfofield
  3983. parameter is a 70-byte data buffer that you must allocate for use by ZIP. You
  3984. must set the first word of this buffer to 0 before you call the GetLocalZones
  3985. function the first time, and not change the contents of this field thereafter.
  3986.         
  3987.  
  3988. æKY GetZoneList
  3989. æFc AppleTalk.h
  3990. æT Function
  3991. æD 
  3992. pascal OSErr GetZoneList(XPPParmBlkPtr thePBptr,Boolean async); 
  3993. æDT OSErr myVariable = GetZoneList((XPPParmBlkPtr) thePBptr,(Boolean) async);
  3994. æRI VI
  3995. æC 
  3996. Parameter block
  3997.   ¨  16  ioResult  word  result code 
  3998.   Æ  26  csCode  word  routine selector; always xCall
  3999.   Æ  28  xppSubCode  word  routine selector; getZoneList
  4000.   Æ  30  xppTimeOut  byte  retry interval in seconds
  4001.   Æ  31  xppRetry  byte  retry count
  4002.   Æ  34  zipBuffPtr  pointer  pointer to data buffer
  4003.   ¨  38  zipNumZones  word  number of names returned
  4004.   ¨  40  zipLastFlag  byte  nonzero if no more names
  4005.   Æ  42  zipInfoField  70 bytes  for use by ZIP; first word set to 0
  4006.  
  4007. The GetZoneList function returns a complete list of all the zone names on the
  4008. internet. Use the GetLocalZones function to obtain a list of only the zone names
  4009. on the local network. 
  4010.  
  4011. The ioResult parameter returns the result of the function; if you call the
  4012. function asynchronously, the function sets this field to 1 as soon as it begins
  4013. execution, and changes the field to the actual result code when it completes
  4014. execution. The csCode and xppSubCode parameters are routine selectors and are
  4015. automatically set by the MPW interface to xCall and getZoneList for this
  4016. function. The xppTimeOut field specifies the amount of time, in seconds, that
  4017. the .ATP driver should wait between attempts to obtain the data. A value of 3 or
  4018. 4 for the xppTimeOut field generally gives good results. The xppRetry field
  4019. specifies the number of times the .ATP driver should attempt to obtain the data
  4020. before returning the ReqFailed (request failed) result code. A value of 3 or 4
  4021. for the xppRetry field usually works well.
  4022.  
  4023. The zipBuffPtr is a pointer to a 578-byte data buffer that you must allocate.
  4024. The Zone Information Protocol returns the zone names into this buffer as Pascal
  4025. strings. The zipNumZones parameter returns the number of zone names that ZIP
  4026. placed in the data buffer. 
  4027.  
  4028. The .XPP driver sets the zipLastFlag field to 1 if there are no more zone names
  4029. for the internet. If the zipLastFlag field is still 0 when the GetZoneList
  4030. function has completed execution, you must empty the data buffer pointed to by
  4031. the zipBuffPtr parameter and immediately call the GetZoneList function again
  4032. without changing the value in the zipInfoField parameter. The zipInfofield
  4033. parameter is a 70-byte data buffer that you must allocate for use by ZIP. You
  4034. must set the first word of this buffer to 0 before you call the GetZoneList
  4035. function the first time, and not change the contents of this field thereafter.
  4036.         
  4037.  
  4038. æKY GetMyZone
  4039. æFc AppleTalk.h
  4040. æT Function
  4041. æD 
  4042. pascal OSErr GetMyZone(XPPParmBlkPtr thePBptr,Boolean async); 
  4043. æDT OSErr myVariable = GetMyZone((XPPParmBlkPtr) thePBptr,(Boolean) async);
  4044. æRI VI
  4045. æC 
  4046. The .XPP driver provides three functions that obtain information about zones.
  4047. All three functions use the Zone Information Protocol to return the names of
  4048. zones: The GetMyZone function returns the AppleTalk zone name of the node on
  4049. which your application is running; the GetLocalZones function returns a list of
  4050. zone names on the network that includes the node on which your application is
  4051. running; and the GetZoneList function returns a complete list of zones on the
  4052. internet.
  4053.  
  4054. Assembly-language note:  The .XPP driver functions all use the same value
  4055. (xCall, which is equal to 246) for the csCode parameter to the xCallParam
  4056. parameter block. The xCall routine uses the value of the xppSubCode parameter to
  4057. distinguish between the functions, as follows:
  4058.  
  4059. Function        xppSubCode      Value
  4060. GetMyZone       getMyZone       7
  4061. GetLocalZones   getLocalZones   5
  4062. GetZoneList     getZoneList     6
  4063.  
  4064. FUNCTION GetMyZone (thePBptr:XCallParamPtr; async: BOOLEAN) : OSErr;
  4065.  
  4066. Parameter block
  4067.   ¨  16  ioResult  word  result code 
  4068.   Æ  26  csCode  word  routine selector; always xCall
  4069.   Æ  28  xppSubCode  word  routine selector; getMyZone
  4070.   Æ  30  xppTimeOut  byte  retry interval in seconds
  4071.   Æ  31  xppRetry  byte  retry count
  4072.   Æ  34  zipBuffPtr  long  pointer to data buffer
  4073.   Æ  42  zipInfoField  70 bytes  for use by ZIP; first word set to 0
  4074.  
  4075. The GetMyZone function returns only the zone name of the node on which your
  4076. application is running.
  4077.  
  4078. The ioResult parameter returns the result of the function; if you call the
  4079. function asynchronously, the function sets this field to 1 as soon as it begins
  4080. execution, and changes the field to the actual result code when it completes
  4081. execution. The csCode and xppSubCode parameters are routine selectors and are
  4082. automatically set by the MPW interface to xCall and getMyZone for this function.
  4083. The xppTimeOut field specifies the amount of time, in seconds, that the .ATP
  4084. driver should wait between attempts to obtain the data. A value of 3 or 4 for
  4085. the xppTimeOut field generally gives good results. The xppRetry field specifies
  4086. the number of times the .ATP driver should attempt to obtain the data before
  4087. returning the ReqFailed (request failed) result code. A value of 3 or 4 for the
  4088. xppRetry field usually works well.
  4089.  
  4090. The zipBuffPtr is a pointer to a 33-byte data buffer that you must allocate. The
  4091. Zone Information Protocol returns the zone name into this buffer as a Pascal
  4092. string. The zipInfo field is a 70-byte data buffer that you must allocate for
  4093. use by ZIP. You must set the first word of this buffer to 0 before you call the
  4094. GetMyZone function.
  4095.  
  4096. Result codes
  4097. noErr          0  no error
  4098. noBridgeErr  –93  no router is available
  4099. reqFailed  –1096  Request to contact router failed; retry count exceeded 
  4100.         
  4101.  
  4102. æKY PAttachPH
  4103. æFc AppleTalk.h
  4104. æT Function
  4105. æD pascal OSErr PAttachPH(MPPPBPtr thePBptr,Boolean async); 
  4106. æDT OSErr myVariable = PAttachPH((MPPPBPtr) thePBptr,(Boolean) async);
  4107. æRI II-308, V-513
  4108. æC AttachPH function
  4109.  
  4110. Parameter block
  4111.     ->  26  csCode        word     ;always attachPH
  4112.     ->  28  protType      byte     ;ALAP protocol type
  4113.     ->  30  handler       pointer  ;protocol handler
  4114.  
  4115. AttachPH adds the protocol handler pointed to by handler to the node's protocol 
  4116. table.  ProtType specifies what kind of frame the protocol handler can service.  
  4117.  
  4118. After AttachPH is called, the protocol handler is called for each incoming frame 
  4119. whose ALAP protocol type equals protType.
  4120.  
  4121. Result codes    
  4122.  
  4123.       noErr         No error
  4124.       lapProtErr    Error attaching protocol type
  4125.  
  4126. æKY PDetachPH
  4127. æFc AppleTalk.h
  4128. æT Function
  4129. æD pascal OSErr PDetachPH(MPPPBPtr thePBptr,Boolean async); 
  4130. æDT OSErr myVariable = PDetachPH((MPPPBPtr) thePBptr,(Boolean) async);
  4131. æRI II-308, V-513
  4132. æC DetachPH function
  4133.  
  4134. Parameter block
  4135.     ->  26  csCode        word      ;always detachPH
  4136.     ->  28  protType      byte      ;ALAP protocol type
  4137.  
  4138. DetachPH removes from the node's protocol table the specified ALAP protocol type 
  4139. and corresponding protocol handler.
  4140.  
  4141. Result codes    
  4142.  
  4143.       noErr           No error
  4144.       lapProtErr      Error detaching protocol type
  4145.  
  4146. æKY PWriteLAP
  4147. æFc AppleTalk.h
  4148. æT Function
  4149. æD pascal OSErr PWriteLAP(MPPPBPtr thePBptr,Boolean async); 
  4150. æDT OSErr myVariable = PWriteLAP((MPPPBPtr) thePBptr,(Boolean) async);
  4151. æRI II-307, V-513
  4152. æC WriteLAP function
  4153.  
  4154. Parameter block
  4155.  
  4156.     ->  26  csCode          word       ;always writeLAP
  4157.     ->  30  wdsPointer      pointer    ;write data structure
  4158.  
  4159. WriteLAP sends a frame to another node.  The frame data and destination of the 
  4160. frame are described by the write data structure pointed to by wdsPointer.  The 
  4161. first two data bytes of an ALAP frame sent to another computer using the 
  4162. AppleTalk Manager must indicate the length of the frame in bytes.  The ALAP 
  4163. protocol type byte must be in the range 1 to 127.
  4164.  
  4165. Result codes    
  4166.  
  4167.       noErr          No error
  4168.       excessCollsns  No CTS received after 32 RTS's
  4169.       ddpLengthErr   Packet length exceeds maximum
  4170.       lapProtErr     Invalid ALAP protocol type
  4171.  
  4172. æKY POpenSkt
  4173. æFc AppleTalk.h
  4174. æT Function
  4175. æD pascal OSErr POpenSkt(MPPPBPtr thePBptr,Boolean async); 
  4176. æDT OSErr myVariable = POpenSkt((MPPPBPtr) thePBptr,(Boolean) async);
  4177. æRI II-311, V-513
  4178. æC OpenSkt function
  4179.  
  4180. Parameter block
  4181.  
  4182.     ->  26  csCode        word         ;always openSkt
  4183.     <-> 28  socket        byte         ;socket number
  4184.     ->  30  listener      pointer      ;socket listener
  4185.  
  4186. OpenSkt adds a socket and its socket listener to the socket table.  If the socket 
  4187. parameter is nonzero, it must be in the range 64 to 127, and it specifies the 
  4188. socket's number; if socket is 0, OpenSkt opens a socket with a socket number in the 
  4189. range 128 to 254, and returns it in the socket parameter.  Listener contains a 
  4190. pointer to the socket listener.
  4191.  
  4192. OpenSkt will return ddpSktErr if you pass the number of an already opened socket, 
  4193. if you pass a socket number greater than 127, or if the socket table is full (the 
  4194. socket table can hold a maximum of 12 sockets).
  4195.  
  4196. Result codes    
  4197.  
  4198.       noErr            No error
  4199.       ddpSktErr        Socket error
  4200.  
  4201. æKY PCloseSkt
  4202. æFc AppleTalk.h
  4203. æT Function
  4204. æD pascal OSErr PCloseSkt(MPPPBPtr thePBptr,Boolean async); 
  4205. æDT OSErr myVariable = PCloseSkt((MPPPBPtr) thePBptr,(Boolean) async);
  4206. æRI II-312,V513
  4207. æC CloseSkt function
  4208.  
  4209. Parameter block
  4210.  
  4211.     ->  26  csCode  word    ;always closeSkt
  4212.     ->  28  socket  byte    ;socket number
  4213.  
  4214. CloseSkt removes the entry of the specified socket from the socket table.  If you 
  4215. pass a socket number of 0, or if you attempt to close a socket that isn't open, 
  4216. CloseSkt will return ddpSktErr.
  4217.  
  4218. Result codes    
  4219.  
  4220.       noErr         No error
  4221.       ddpSktErr     Socket error
  4222.  
  4223. æKY PWriteDDP
  4224. æFc AppleTalk.h
  4225. æT Function
  4226. æD pascal OSErr PWriteDDP(MPPPBPtr thePBptr,Boolean async); 
  4227. æDT OSErr myVariable = PWriteDDP((MPPPBPtr) thePBptr,(Boolean) async);
  4228. æRI II-312,V-513
  4229. æC WriteDDP function
  4230.  
  4231. Parameter block
  4232.  
  4233.     ->  26  csCode            word        ;always writeDDP
  4234.     ->  28  socket            byte        ;socket number
  4235.     ->  29  checksumFlag      byte        ;checksum flag
  4236.     ->  30  wdsPointer        pointer     ;write data structure
  4237.  
  4238. WriteDDP sends a datagram to another socket.  WDSPointer points to a write data 
  4239. structure containing the datagram and the address of the destination socket.  If 
  4240. checksumFlag is TRUE, WriteDDP will compute the checksum for all datagrams 
  4241. requiring long headers.
  4242.  
  4243. Result codes    
  4244.  
  4245.       noErr          No error
  4246.       ddpLenErr      Datagram length too big
  4247.       ddpSktErr      Socket error
  4248.       noBridgeErr    No bridge found 
  4249.  
  4250. æKY PRegisterName
  4251. æFc AppleTalk.h
  4252. æT Function
  4253. æD pascal OSErr PRegisterName(MPPPBPtr thePBptr,Boolean async); 
  4254. æDT OSErr myVariable = PRegisterName((MPPPBPtr) thePBptr,(Boolean) async);
  4255. æRI II-322,V-513
  4256. æC RegisterName function
  4257.  
  4258. Parameter block
  4259.  
  4260.     ->  26  csCode           word       ;always registerName
  4261.     ->  28  interval         byte       ;retry interval
  4262.     <-> 29  count            byte       ;retry count
  4263.     ->  30  ntQElPtr         pointer    ;names table element pointer 
  4264.     ->  34  verifyFlag       byte       ;set if verify needed 
  4265.  
  4266. RegisterName adds the name and address of an entity to the node's names table.  
  4267. NTQElPtr points to a names table entry containing the entity's name and internet 
  4268. address (in the form shown in Figure 13 above).  Meta-characters aren't allowed in 
  4269. the object and type fields of the entity name; the zone field, however, must contain 
  4270. the meta-character "*".  If verifyFlag is TRUE, RegisterName checks on the network 
  4271. to see if the name is already in use, and returns a result code of nbpDuplicate if so.  
  4272.  
  4273. Interval and count contain the retry interval in eight-tick units and the retry count.  
  4274. When a retry is made, the count field is modified.
  4275.  
  4276. Warning:  The names table entry passed to RegisterName remains the 
  4277.           property of NBP until removed from the names table.  Don't attempt to remove 
  4278.           or modify it.  If you've allocated memory using a NewHandle call, you must 
  4279.           lock it as long as the name is registered. 
  4280.  
  4281. Warning:  VerifyFlag should normally be set before calling RegisterName.
  4282.  
  4283. Result codes    
  4284.  
  4285.    noErr             No error
  4286.    nbpDuplicate      Duplicate name already exists
  4287.    nbpNISErr         Error opening names information socket 
  4288.  
  4289. æKY PLookupName
  4290. æFc AppleTalk.h
  4291. æT Function
  4292. æD pascal OSErr PLookupName(MPPPBPtr thePBptr,Boolean async); 
  4293. æDT OSErr myVariable = PLookupName((MPPPBPtr) thePBptr,(Boolean) async);
  4294. æRI II-323,V-513
  4295. æC LookupName function
  4296.  
  4297. Parameter block
  4298.  
  4299.     ->   26 csCode             word         ;always lookupName
  4300.     ->      28  interval       byte         ;retry interval
  4301.     <->     29  count          byte         ;retry count
  4302.     ->      30  entityPtr      pointer      ;pointer to entity name
  4303.     ->      34  retBuffPtr     pointer      ;pointer to buffer
  4304.     ->      38  retBuffSize    word         ;buffer size in bytes
  4305.     ->      40  maxToGet       word         ;matches to get
  4306.     <->     42  numGotten      word         ;matches found 
  4307.  
  4308. LookupName returns the addresses of all entities with a specified name.  EntityPtr 
  4309. points to the entity's name (in the form shown in Figure 13 above).  Meta-
  4310. characters are allowed in the entity name.  RetBuffPtr and retBuffSize contain the 
  4311. location and size of an area of memory in which the tuples describing the entity 
  4312. names and their corresponding addresses should be returned.  MaxToGet indicates 
  4313. the maximum number of matching names to find addresses for; the actual number of 
  4314. addresses found is returned in numGotten.  Interval and count contain the retry 
  4315. interval and the retry count.  LookupName completes when either the number of 
  4316. matches is equal to or greater than maxToGet, or the retry count has been exceeded.  
  4317. The count field is decremented for each retransmission.
  4318.  
  4319. Note:  NumGotten is first set to 0 and then incremented with each match 
  4320.        found.  You can test the value in this field, and can start examining the 
  4321.        received addresses in the buffer while the lookup continues.
  4322.  
  4323. Result codes    
  4324.  
  4325.       noErr           No error
  4326.       nbpBuffOvr      Buffer overflow
  4327.  
  4328. æKY PConfirmName
  4329. æFc AppleTalk.h
  4330. æT Function
  4331. æD pascal OSErr PConfirmName(MPPPBPtr thePBptr,Boolean async); 
  4332. æDT OSErr myVariable = PConfirmName((MPPPBPtr) thePBptr,(Boolean) async);
  4333. æRI II-323,V-513
  4334. æC ConfirmName function
  4335.  
  4336. Parameter block
  4337.  
  4338.     ->   26 csCode            word         ;always confirmName
  4339.     ->   28 interval          byte         ;retry interval
  4340.     <->  29  count            byte         ;retry count
  4341.     ->   30 entityPtr         pointer      ;pointer to entity name
  4342.     ->   34 confirmAddr       pointer      ;entity address
  4343.     <-   38 newSocket         byte         ;socket number
  4344.  
  4345. ConfirmName confirms that an entity known by name and address still exists (is 
  4346. still entered in the names directory).  EntityPtr points to the entity's name (in the 
  4347. form shown in Figure 13 above).  ConfirmAddr specifies the address to confirmed.  
  4348.  
  4349. No meta-characters are allowed in the entity name.  Interval and count contain the 
  4350. retry interval and the retry count.  The socket number of the entity is returned in 
  4351. newSocket.  ConfirmName is more efficient than LookupName in terms of network 
  4352. traffic.
  4353.  
  4354. Result codes    
  4355.  
  4356.       noErr             No error
  4357.       nbpConfDiff       Name confirmed for different socket
  4358.       nbpNoConfirm      Name not confirmed
  4359.  
  4360. æKY PRemoveName
  4361. æFc AppleTalk.h
  4362. æT Function
  4363. æD pascal OSErr PRemoveName(MPPPBPtr thePBptr,Boolean async); 
  4364. æDT OSErr myVariable = PRemoveName((MPPPBPtr) thePBptr,(Boolean) async);
  4365. æRI II-324,V-513
  4366. æC RemoveName function
  4367.  
  4368. Parameter block
  4369.  
  4370.     ->  26  csCode        word        ;always removeName 
  4371.     ->  30  entityPtr     pointer     ;pointer to entity name 
  4372.  
  4373. RemoveName removes an entity name from the names table of the given entity's node.
  4374.  
  4375. Result codes    
  4376.  
  4377.    noErr            No error
  4378.    nbpNotFound      Name not found 
  4379.  
  4380. æKY PSetSelfSend
  4381. æFc AppleTalk.h
  4382. æT Function
  4383. æD pascal OSErr PSetSelfSend(MPPPBPtr thePBptr,Boolean async); 
  4384. æDT OSErr myVariable = PSetSelfSend((MPPPBPtr) thePBptr,(Boolean) async);
  4385. æRI V-516
  4386. æC  
  4387. _______________________________________________________________________________
  4388.  
  4389. »SENDING PACKETS TO ONE’S OWN NODE
  4390. _______________________________________________________________________________
  4391.  
  4392. Upon opening, the ability to send a packet to one’s own node (intranode delivery) is
  4393. disabled.  This feature of the AppleTalk Manager can be manipulated through the
  4394. SetSelfSend function.  Once enabled, it is possible, at all levels, to send packets
  4395. to entities within one’s own node.  An example of where this might be desirable is an
  4396. application sending data to a print spooler that is actually running in the background
  4397. on the same node.
  4398.  
  4399. Enabling (or disabling) this feature affects the entire node and should be performed
  4400. with care.  For instance, a desk accessory may not expect to receive names from
  4401. within its own node as a response to an NBP look-up;  enabling this feature from an
  4402. application could break the desk accessory.  All future programs should be written
  4403. with this feature in mind.
  4404.  
  4405. FUNCTION PSetSelfSend (thePBptr: MPPPBPtr; async: BOOLEAN) : OSErr;
  4406.  
  4407. Parameter Block
  4408.   -->    26    csCode         word    Always PSetSelfSend
  4409.   -->    28    newSelfFlag    byte    New SelfSend flag
  4410.   <--    29    oldSelfFlag    byte    Old SelfSend flag
  4411.  
  4412. PSetSelfSend enables or disables the intranode delivery feature of the AppleTalk
  4413. Manager.  If newSelfFlag is nonzero, the feature will be enabled; otherwise it will
  4414. be disabled.  The previous value of the flag will be returned in oldSelfFlag.
  4415.  
  4416. Result Codes    noErr        No error
  4417.  
  4418. æKY PKillNBP
  4419. æFc AppleTalk.h
  4420. æT Function
  4421. æD pascal OSErr PKillNBP(MPPPBPtr thePBptr,Boolean async); 
  4422. æDT OSErr myVariable = PKillNBP((MPPPBPtr) thePBptr,(Boolean) async);
  4423. æRI V-518
  4424. æC  
  4425. _______________________________________________________________________________
  4426.  
  4427. »NAME BINDING PROTOCOL CHANGES
  4428. _______________________________________________________________________________
  4429.  
  4430. Changes to the Name Binding Protocol include supporting multiple concurrent requests
  4431. and a means for aborting an active request.
  4432.  
  4433. »Multiple Concurrent NBP Requests
  4434.  
  4435. NBP now supports multiple concurrent active requests.  Specifically, a number of
  4436. LookupNames, RegisterNames and ConfirmNames can all be active concurrently.  The
  4437. maximum number of  concurrent requests is machine dependent; if it is exceeded the
  4438. error tooManyReqs will be returned.  Active requests can be aborted by the PKillNBP
  4439. call.
  4440.  
  4441. »KillNBP function
  4442.  
  4443. FUNCTION PKillNBP (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr;
  4444.  
  4445. •••Refer to Technical Note #199:•••
  4446.  
  4447. Parameter block
  4448.   -->    26    csCode    word     Always PKillNBP
  4449.   -->    28    aKillQEl  pointer  Pointer to queue element
  4450.  
  4451. PKillNBP is used to abort an outstanding LookupName, RegisterName or ConfirmName
  4452. request.  To abort one of these calls, place a pointer to the queue element of the
  4453. call to abort in a KillQEl and issue the PKillNBP call.  The call will be completed
  4454. with a ReqAborted error.
  4455.  
  4456. Result Codes    noErr          No error
  4457.                 cbNotFound     aKillQEl does not point to a valid
  4458.                                NBP queue element
  4459.  
  4460. æKY PGetAppleTalkInfo
  4461. æFc AppleTalk.h
  4462. æT Function
  4463. æD 
  4464. pascal OSErr PGetAppleTalkInfo(MPPPBPtr thePBptr,Boolean async); 
  4465. æDT OSErr myVariable = PGetAppleTalkInfo((MPPPBPtr) thePBptr,(Boolean) async);
  4466. æRI VI
  4467. æC  
  4468. You can use the PGetAppleTalkInfo function to obtain information about the .MPP
  4469. driver. In addition to the node ID and other information pointed to by the
  4470. ABusVars global variable (discussed in the AppleTalk Manager chapter of Volume
  4471. II), the PGetAppleTalkInfo function returns 
  4472.  
  4473.   •   a pointer to the .MPP driver’s device control entry data structure (DCE)
  4474.  
  4475.   •   configuration flags, which indicate the status of certain conditions that
  4476.       are set at startup
  4477.  
  4478.   •   a value (the selfSend flag) that indicates whether the node can send
  4479.       packets to itself
  4480.  
  4481.   •   the network number range for the network to which the node is attached
  4482.  
  4483.   •   the 8-bit node ID and 16-bit network number of the node
  4484.  
  4485.   •   the 8-bit node ID and 16-bit network number of the last router from which
  4486.       the node has heard
  4487.  
  4488.   •   the maximum capacities of the .MPP driver—such as the maximum number of
  4489.       protocol handlers and the maximum number of static sockets allowed by
  4490.       this driver
  4491.  
  4492.   •   a pointer to the registered names queue
  4493.  
  4494.   •   the node address of the node on the underlying data link (for example,
  4495.       the Ethernet hardware address)
  4496.  
  4497.   •   the node’s zone name
  4498.  
  4499. The data link address (for example, the Ethernet hardware address) and the zone
  4500. name are returned only for extended networks; that is, network types that allow
  4501. more than one network per cable. You must allocate memory for and provide
  4502. pointers to the data buffers into which the PGetAppleTalkInfo function returns
  4503. the data link address and zone name. You use the laLength parameter to specify
  4504. the length of the data link address you want returned; the function returns the
  4505. actual length of the data in the laLength parameter and returns the data in the
  4506. buffer you provide.
  4507.  
  4508. Note:  Always use the PGetAppleTalkInfo function to obtain information about the
  4509. .MPP driver. You can no longer rely on the validity of the global variables
  4510. described in the AppleTalk chapter of Inside Macintosh, Volume II.
  4511.  
  4512. FUNCTION PGetAppleTalkInfo (thePBptr: MPPPBPtr; async: BOOLEAN) : OSErr;
  4513.  
  4514. Parameter block
  4515.   ¨  16  ioResult  word  result code 
  4516.   Æ  26  csCode  word  always PGetAppleTalkInfo
  4517.   Æ  28  version  word  version of function
  4518.   ¨  30  varsPtr  pointer  pointer to MPP globals
  4519.   ¨  34  dcePtr  pointer  pointer to DCE for .MPP
  4520.   ¨  38  portID  word  port number 
  4521.   ¨  40  configuration  long  configuration flags
  4522.   ¨  44  selfSend  word  nonzero if self-send is enabled
  4523.   ¨  46  netLo  word  low value of the network range
  4524.   ¨  48  netHi  word  high value of the network range
  4525.   ¨  50  ourAddr  long  local 24-bit AppleTalk address
  4526.   ¨  54  routerAddr  long  24-bit address of router
  4527.   ¨  58  numOfPHs  word  max number of protocol handlers
  4528.   ¨  60  numOfSkts  word  max number of static sockets
  4529.   ¨  62  numNBPEs  word  max concurrent NBP requests
  4530.   ¨  64  ntQueue  pointer  pointer to registered name queue
  4531.   ´  68  laLength  word  length in bytes of data link address
  4532.           (extended networks only)
  4533.   Æ  70  linkAddr  pointer  pointer to data link address buffer
  4534.           (extended networks only)
  4535.   Æ  74  zoneName  pointer  pointer to zone name buffer
  4536.  
  4537. The PGetAppleTalkInfo function returns information about the .MPP driver. If the
  4538. node on which your program is running happens also to be running AppleTalk
  4539. Internet Router software in the background, there may be more than one set of 
  4540. .MPP global variables in RAM. To make sure you are obtaining information about
  4541. the .MPP driver that handles application software, always use the
  4542. PGetAppleTalkInfo function rather than the Device Manager’s PBControl function.
  4543. If you are using assembly language, or want to use the PBControl function, you
  4544. must use a device driver reference number of –10 for the .MPP driver.
  4545.  
  4546. Parameters
  4547.  
  4548. ioResult
  4549. The result of the function. When you execute the function asynchronously, the
  4550. function sets this parameter to 1 and returns a function result of noErr as soon
  4551. as the function begins execution. When the function completes execution, it sets
  4552. the ioResult parameter to the actual result code. 
  4553.  
  4554. csCode
  4555. Routine selector, automatically set by the MPW interface. Always equal to
  4556. PGetAppleTalkInfo for this function.
  4557.  
  4558. version
  4559. The version number of the PGetAppleTalkInfo function you are calling. For
  4560. version number 53 of the .MPP driver, this number is always 1.
  4561.  
  4562. varsPtr
  4563. A pointer to the MPP global variables. The MPP global variables are discussed in
  4564. “Protocol Handlers and Socket Listeners” in Chapter 10 of Volume II.
  4565.  
  4566. dcePtr
  4567. A pointer to the device control entry (DCE) data structure for the .MPP driver.
  4568. The DCE is described in the Device Manager chapters of Volumes II and V.
  4569.  
  4570. portID
  4571. The port number for the .MPP driver. The port number is always 0 unless you are
  4572. requesting information for an .MPP driver being used by a router.
  4573.  
  4574. configuration
  4575. A 32-bit long word of configuration flags. The following flags are currently
  4576. defined:
  4577.  
  4578. Bit  Flag       Description
  4579. 31   SrvAdrBit  TRUE (1) if the routine that opened the .MPP driver requested a
  4580. server node number. Server node numbers are described in the AppleTalk Manager
  4581. of Volume V. This flag indicates only that the server-node number was requested,
  4582. not that it was returned. Some AppleTalk devices, such as EtherTalk, do not
  4583. honor a request for a server-node number.
  4584.  
  4585. 30   RouterBit  TRUE (1) if an AppleTalk Internet Router was loaded at system
  4586. startup (that is, there's a router operating on the same node as your
  4587. application). A router can be loaded but not active.
  4588.  
  4589. 15   ExtendedBit  TRUE (1) if the node is on an extended network.
  4590.  
  4591. 7    BadZoneHintBit  TRUE (1) if the zone name of the node you are on was not
  4592. the same as the zone name stored in parameter RAM (sometimes referred to as the
  4593. zone name hint) when the .MPP driver was opened. If the zone name hint is
  4594. invalid, then the AppleTalk Manager uses the default zone for the network.
  4595.  
  4596. 6    OneZoneBit  TRUE (1) if only one zone is assigned to your extended network
  4597. or if you are not on an extended network.
  4598.  
  4599. selfSend
  4600. This parameter is nonzero if the ability of a node to send packets to itself is
  4601. enabled. Use the PSetSelfSend function, described in the AppleTalk Manager
  4602. chapter of Volume V, to enable or disable this feature.
  4603.  
  4604. netLo
  4605. The low value of the range of network numbers on the local cable. Only extended
  4606. networks can have a range of network numbers. For a nonextended network, this
  4607. parameter returns the network number.
  4608.  
  4609. netHi
  4610. The high value of the range of network numbers on the local cable. Only extended
  4611. networks can have a range of network numbers. For a nonextended network, this
  4612. parameter returns the network number.
  4613.  
  4614. ourAddr
  4615. The 24-bit AppleTalk network address of the node you are on. The least
  4616. significant byte of the longword is the node ID. The middle 16 bits are the
  4617. network number. The most significant byte of the longword is reserved for use by
  4618. Apple Computer, Inc. 
  4619.  
  4620. routerAddr
  4621. The 24-bit AppleTalk network address of the last router from which your node
  4622. heard traffic. The least significant byte of the longword is the node ID. The
  4623. middle 16 bits are the network number. The most significant byte of the longword
  4624. is reserved for use by Apple Computer, Inc. You should always use this address
  4625. when you want to communicate with a router.
  4626.  
  4627. numOfPHs
  4628. The maximum number of protocol handlers that this .MPP driver allows.
  4629.  
  4630. numOfSkts
  4631. The maximum number of statically assigned sockets that this .MPP driver allows.
  4632. Statically assigned sockets are described in Inside AppleTalk.
  4633.  
  4634. numNBPEs
  4635. The maximum number of concurrent requests to NBP that this .MPP driver allows. 
  4636.  
  4637. ntQueue
  4638. A pointer to the first entry in the names table for the local node. You can use
  4639. NBP routines to look up and register names in the names table. The names table
  4640. is described in “Name-Binding Protocol” in Chapter 10 of Volume II.
  4641.  
  4642. laLength
  4643. When you call the PGetAppleTalkInfo function on a node on an extended network,
  4644. you use this parameter to specify the number of bytes of the data link address
  4645. the function should place in the buffer pointed to by the LinkAddr parameter. If
  4646. you request more bytes than the total number of bytes in the address, then the
  4647. function returns in the laLength parameter the actual number of bytes it placed
  4648. in the buffer. If the address is longer than the size of the buffer, then the
  4649. PGetAppleTalkInfo function fills the buffer and returns in the laLength
  4650. parameter the actual length of the address, not the number of bytes returned.
  4651. The function does not return an error when the buffer is too large or too small
  4652. for the address.
  4653.  
  4654. linkAddr
  4655. A pointer to a buffer for the data link address returned for extended networks
  4656. only. You use the laLength parameter to specify the number of bytes of the
  4657. address that you want placed in this buffer. You must allocate a buffer large
  4658. enough to hold the number of bytes you specify. Speficy NIL for this parameter
  4659. if you do not want the function to provide a data-link address.
  4660.  
  4661. zoneName
  4662. A pointer to a buffer into which the PGetAppleTalkInfo function places the local
  4663. node’s zone name. You must allocate a buffer of at least 33 bytes to hold this
  4664. data, or specify NIL for the ZoneName parameter if you do not want to obtain the
  4665. zone name. This field is returned only if the node is on an extended network.
  4666.  
  4667. Result codes
  4668. noErr  0  no error
  4669.  
  4670.  
  4671.  
  4672. æKY PATalkClosePrep
  4673. æFc AppleTalk.h
  4674. æT Function
  4675. æD 
  4676. pascal OSErr PATalkClosePrep(MPPPBPtr thePBptr,Boolean async); 
  4677. æDT OSErr myVariable = PATalkClosePrep((MPPPBPtr) thePBptr,(Boolean) async);
  4678. æRI VI
  4679. æC  
  4680. Whereas it is unlikely that opening the .MPP driver will adversely affect
  4681. another program, an application should never close the .MPP driver, because
  4682. another program might be using it. Under certain circumstances, however, the
  4683. system might close the .MPP driver, provided no application objects. The system
  4684. uses the .MPP driver’s PATalkClosePrep function to inform each routine in the
  4685. AppleTalk Transition Queue that it intends to close the .MPP driver, giving each
  4686. routine in the queue the opportunity to deny permission to do so.
  4687.  
  4688. The system provides a pointer to a 255-byte buffer when it calls the
  4689. PATalkClosePrep function. If any routine in the AppleTalk Transition Queue
  4690. denies permission to close the .MPP driver, it places a name in the buffer and
  4691. returns control to the AppleTalk Manager. The name that the routine places in
  4692. the buffer should be the name of the application that placed the entry in the
  4693. queue. The PATalkClosePrep function then calls each routine in the AppleTalk
  4694. Transition Queue a second time to inform it that the request to close the .MPP
  4695. driver has been canceled. If any routine in the AppleTalk Transition Queue
  4696. denies permission to close the .MPP driver, the PATalkClosePrep function returns
  4697. the result code closeErr.
  4698.  
  4699. If any routine denies permission to close the .MPP driver, the system displays a
  4700. dialog box informing the user that another application is using the .MPP driver,
  4701. and showing the name that the AppleTalk Transition Queue routine placed in the
  4702. buffer. The dialog box gives the user the option of canceling the request to
  4703. close AppleTalk, or of closing AppleTalk anyway. 
  4704.  
  4705. Note:  If the user chooses to close AppleTalk despite the fact that an
  4706. application is using it, the system calls the MPPClose function. AppleTalk calls
  4707. each application in the AppleTalk Transition Queue again, this time informing it
  4708. that AppleTalk is about to close. In this case, your AppleTalk Transition Queue
  4709. routine must prepare for the imminent closing of AppleTalk; it cannot deny
  4710. permission to the MPPClose function.
  4711.   
  4712. FUNCTION PATalkClosePrep (thePBptr: MPPPBPtr; async: BOOLEAN) : OSErr;
  4713.  
  4714. Parameter block
  4715.   Æ  26  csCode  word  always PATalkClosePrep
  4716.   Æ      appName  pointer  buffer for name of application that denies request
  4717.  
  4718. The PATalkClosePrep function calls each routine listed in the AppleTalk
  4719. Transition Queue to request permission to close the .MPP driver. 
  4720. The routine that calls the PATalkClosePrep function must allocate a 255-byte
  4721. buffer and provide a pointer to it in the appName parameter. If a routine in the
  4722. AppleTalk Transition Queue denies permission to close the .MPP driver, that
  4723. routine places a name in the buffer pointed to by the appName parameter, and the
  4724. AppleTalk Manager calls each routine in the AppleTalk Transition Queue a second
  4725. time to inform it that the request to close the .MPP driver has been canceled.
  4726. The PATalkClosePrep function then returns the result code closeErr, indicating
  4727. that the calling routine may not close the .MPP driver. The csCode parameter is
  4728. a routine selector; it is always equal to PATalkClosePrep for this function.
  4729.  
  4730. Result codes
  4731. noErr       0  no error
  4732. closeErr  –24  permission to close .MPP driver was denied
  4733.  
  4734. æKY PCancelATalkClosePrep
  4735. æFc AppleTalk.h
  4736. æT Function
  4737. æD 
  4738. pascal OSErr PCancelATalkClosePrep(MPPPBPtr thePBptr,Boolean async); 
  4739. æDT OSErr myVariable = PCancelATalkClosePrep((MPPPBPtr) thePBptr,(Boolean) async);
  4740. æRI VI
  4741. æC  
  4742. The system can use the PCancelATClosePrep function to undo the effects of the
  4743. PATalkClosePrep function. The system uses this function, for example, if some
  4744. condition prevents it from closing the .MPP driver even though each routine
  4745. listed in the AppleTalk Transition Queue gave permission to close it. When the
  4746. system calls the PCancelATClosePrep function, the AppleTalk Manager calls each
  4747. routine in the AppleTalk Transition Queue to inform it that the request to close
  4748. the .MPP driver has been canceled.
  4749.  
  4750. FUNCTION PCancelATClosePrep (thePBptr: MPPPBPtr; async: BOOLEAN) : OSErr;
  4751.  
  4752. Parameter block
  4753.   Æ  26  csCode  word  always PCancelATClosePrep 
  4754.  
  4755. The PCancelATClosePrep function undoes the effects of the PATalkClosePrep
  4756. function. The PCancelATClosePrep function calls each routine in the AppleTalk
  4757. Transition Queue to inform it that the request to close the .MPP driver has been
  4758. canceled. 
  4759.  
  4760. The operating system uses this function, for example, if some condition prevents
  4761. it from closing the .MPP driver even though each routine listed in the AppleTalk
  4762. Transition Queue gave permission to close it. 
  4763.  
  4764. The csCode parameter is a routine selector, always equal to PCancelATClosePrep
  4765. for this function.
  4766.  
  4767. Result codes
  4768. noErr  0  no error
  4769.  
  4770. æKY POpenATPSkt
  4771. æFc AppleTalk.h
  4772. æT Function
  4773. æD pascal OSErr POpenATPSkt(ATPPBPtr thePBptr,Boolean async); 
  4774. æDT OSErr myVariable = POpenATPSkt((ATPPBPtr) thePBptr,(Boolean) async);
  4775. æRI II-315,V-513
  4776. æC OpenATPSkt function
  4777.  
  4778. Parameter block
  4779.  
  4780.     ->  26 csCode         word          ;always openATPSkt
  4781.     <-> 28  atpSocket     byte          ;socket number
  4782.     ->  30  addrBlock     long word     ;socket request specification
  4783.  
  4784. OpenATPSkt opens a socket for the purpose of receiving requests.  ATPSocket 
  4785. contains the socket number of the socket to open.  If it's 0, a number is dynamically 
  4786. assigned and returned in atpSocket.  AddrBlock contains a specification of the 
  4787. socket addresses from which requests will be accepted.  A 0 in the network number, 
  4788. node ID, or socket number field of addrBlock means that requests will be accepted 
  4789. from every network, node, or socket, respectively.
  4790.  
  4791. Result codes    
  4792.  
  4793.       noErr             No error
  4794.       tooManySkts       Too many responding sockets
  4795.       noDataArea        Too many outstanding ATP calls
  4796.  
  4797. æKY PCloseATPSkt
  4798. æFc AppleTalk.h
  4799. æT Function
  4800. æD pascal OSErr PCloseATPSkt(ATPPBPtr thePBPtr,Boolean async); 
  4801. æDT OSErr myVariable = PCloseATPSkt((ATPPBPtr) thePBPtr,(Boolean) async);
  4802. æRI II-316,V-513
  4803. æC CloseATPSkt function
  4804.  
  4805. Parameter block
  4806.     ->  26  csCode      word    ;always closeATPSkt
  4807.     ->  28  atpSocket   byte    ;socket number
  4808.  
  4809. CloseATPSkt closes the socket whose number is specified by atpSocket, for the 
  4810. purpose of receiving requests.
  4811.  
  4812. Result codes    
  4813.    noErr      No error
  4814.  
  4815. æKY PSendRequest
  4816. æFc AppleTalk.h
  4817. æT Function
  4818. æD pascal OSErr PSendRequest(ATPPBPtr thePBPtr,Boolean async); 
  4819. æDT OSErr myVariable = PSendRequest((ATPPBPtr) thePBPtr,(Boolean) async);
  4820. æRI II-316,V-513
  4821. æC SendRequest function
  4822.  
  4823. Parameter block
  4824.  
  4825.     ->  18  userData           long word      ;user bytes
  4826.     <-  22  reqTID             word           ;transaction ID used in request
  4827.     ->  26  csCode             word           ;always sendRequest
  4828.     <-  28  currBitMap         byte           ;bit map
  4829.     <-> 29  atpFlags           byte           ;control information
  4830.     ->  30  addrBlock          long word      ;destination socket address
  4831.     ->  34 reqLength           word           ;request size in bytes
  4832.     ->  36 reqPointer          pointer        ;pointer to request data
  4833.     ->  40 bdsPointer          pointer        ;pointer to response BDS
  4834.     ->  44 numOfBuffs          byte           ;number of responses expected
  4835.     ->  45 timeOutVal          byte           ;timeout interval
  4836.     <-  46 numOfResps          byte           ;number of responses received
  4837.     <-> 47  retryCount         byte           ;number of retries
  4838.  
  4839. SendRequest sends a request to another socket and waits for a response.  UserData 
  4840. contains the four user bytes.  AddrBlock indicates the socket to which the request 
  4841. should be sent.  ReqLength and reqPointer contain the size and location of the 
  4842. request to send.  BDSPointer points to a response BDS where the responses are to be 
  4843. returned; numOfBuffs indicates the number of responses requested.  The number of 
  4844. responses received is returned in numOfResps.  If a nonzero value is returned in 
  4845. numOfResps, you can examine currBitMap to determine which packets of the 
  4846. transaction were actually received and to detect pieces for higher-level recovery, 
  4847. if desired.
  4848.  
  4849. TimeOutVal indicates the number of seconds that SendRequest should wait for a 
  4850. response before resending the request.  RetryCount indicates the maximum number 
  4851. of retries SendRequest should attempt.  The end-of-message flag of atpFlags will 
  4852. be set if the EOM bit is set in the last packet received in a valid response sequence.  
  4853. The exactly-once flag should be set if you want the request to be part of an 
  4854. exactly-once transaction.
  4855.  
  4856. To cancel a SendRequest call, you need the transaction ID; it's returned in reqTID.  
  4857. You can examine reqTID before the completion of the call, but its contents are valid 
  4858. only after the tidValid bit of atpFlags has been set.
  4859. SendRequest completes when either an entire response is received or the retry 
  4860. count is exceeded.
  4861.  
  4862. Note:  The value provided in retryCount will be modified during SendRequest 
  4863.        if any retries are made.  This field is used to monitor the number of retries; 
  4864.        for each retry, it's decremented by 1.
  4865.  
  4866. Result codes    
  4867.  
  4868.    noErr             No error
  4869.       reqFailed      Retry count exceeded
  4870.       tooManyReqs      Too many concurrent requests
  4871.       noDataArea        Too many outstanding ATP calls
  4872.       reqAborted        Request canceled by user
  4873.  
  4874. æKY PGetRequest
  4875. æFc AppleTalk.h
  4876. æT Function
  4877. æD pascal OSErr PGetRequest(ATPPBPtr thePBPtr,Boolean async); 
  4878. æDT OSErr myVariable = PGetRequest((ATPPBPtr) thePBPtr,(Boolean) async);
  4879. æRI II-317,V-513
  4880. æC GetRequest function
  4881.  
  4882. Parameter block
  4883.  
  4884.     <-   18 userData         long word     ;user bytes
  4885.     ->   26 csCode           word          ;always getRequest
  4886.     ->   28 atpSocket        byte          ;socket number
  4887.     <-   29 atpFlags         byte          ;control information
  4888.     <-   30 addrBlock        long word     ;source of request
  4889.     <->  34  reqLength       word          ;request buffer size
  4890.     ->   36 reqPointer       pointer       ;pointer to request buffer
  4891.     <-   44 bitMap           byte          ;bit map
  4892.     <-   46  transID         word          ;transaction ID
  4893.  
  4894. GetRequest sets up the mechanism to receive a request sent by a SendRequest call.  
  4895. UserData returns the four user bytes from the request.  ATPSocket contains the 
  4896. socket number of the socket that should listen for a request.  The internet address 
  4897. of the socket from which the request was sent is returned in addrBlock.  ReqLength 
  4898. and reqPointer indicate the size (in bytes) and location of a buffer to store the 
  4899. incoming request.  The actual size of the request is returned in reqLength.  The 
  4900. transaction bit map and transaction ID will be returned in bitMap and transID.  The 
  4901. exactly-once flag in atpFlags will be set if the request is part of an exactly-once 
  4902. transaction.
  4903.  
  4904. GetRequest completes when a request is received.
  4905.  
  4906. Result codes    
  4907.  
  4908.    noErr         No error
  4909.    badATPSkt     Bad responding socket
  4910.  
  4911. æKY PSendResponse
  4912. æFc AppleTalk.h
  4913. æT Function
  4914. æD pascal OSErr PSendResponse(ATPPBPtr thePBPtr,Boolean async); 
  4915. æDT OSErr myVariable = PSendResponse((ATPPBPtr) thePBPtr,(Boolean) async);
  4916. æRI II-317,V-513
  4917. æC SendResponse function
  4918.  
  4919. Parameter block
  4920.  
  4921.     <-  18  userData      long word     ;user bytes from TRel
  4922.     <-  22  reqTID        word          ;transaction ID used in request
  4923.     ->  26  csCode        word          ;always sendResponse
  4924.     ->  28  atpSocket     byte          ;socket number
  4925.     ->  29  atpFlags      byte          ;control information
  4926.     ->  30  addrBlock    long word      ;response destination
  4927.     ->  40  bdsPointer    pointer       ;pointer to response BDS 
  4928.     ->  44  numOfBuffs    byte          ;number of response packets being sent
  4929.     ->  45  bdsSize       byte          ;BDS size in elements
  4930.     ->  46  transID       word          ;transaction ID 
  4931.  
  4932. SendResponse sends a response to a socket.  If the response was part of an exactly-
  4933. once transaction, userData will contain the user bytes from the TRel packet.  
  4934. ATPSocket contains the socket number from which the response should be sent.  The 
  4935. end-of-message flag in atpFlags should be set if the response contains the final 
  4936. packet in a transaction composed of a group of packets and the number of responses 
  4937. is less than requested.  AddrBlock indicates the address of the socket to which the 
  4938. response should be sent.  BDSPointer points to a response BDS containing room for 
  4939. the maximum number of responses to be sent; bdsSize contains this maximum 
  4940. number.  NumOfBuffs contains the number of response packets to be sent in this 
  4941. call; you may wish to make AddResponse calls to complete the response.  TransID 
  4942. indicates the transaction ID of the associated request.
  4943.  
  4944. During exactly-once transactions, SendResponse doesn't complete until either a 
  4945. TRel packet is received from the socket that made the request, or the retry count is 
  4946. exceeded.
  4947.  
  4948. Result codes    
  4949.  
  4950.       noErr              No error
  4951.       badATPSkt          Bad responding socket
  4952.       noRelErr           No release received
  4953.       noDataArea         Too many outstanding ATP calls
  4954.       badBuffNum         Sequence number out of range
  4955.  
  4956. æKY PAddResponse
  4957. æFc AppleTalk.h
  4958. æT Function
  4959. æD pascal OSErr PAddResponse(ATPPBPtr thePBPtr,Boolean async); 
  4960. æDT OSErr myVariable = PAddResponse((ATPPBPtr) thePBPtr,(Boolean) async);
  4961. æRI II-318,V-513
  4962. æC AddResponse function
  4963.  
  4964. Parameter block
  4965.  
  4966.     ->  18  userData        long word   ;user bytes
  4967.     ->  26  csCode          word        ;always addResponse
  4968.     ->  28  atpSocket       byte        ;socket number
  4969.     ->  29  atpFlags        byte        ;control information
  4970.     ->  30  addrBlock       long word   ;response destination
  4971.     ->  34  reqLength       word        ;response size
  4972.     ->  36  reqPointer      pointer     ;pointer to response
  4973.     ->  44  rspNum          byte        ;sequence number
  4974.     ->  46  transID         word        ;transaction ID
  4975.  
  4976. AddResponse sends an additional response packet to a socket that has already been 
  4977. sent the initial part of a response via SendResponse.  UserData contains the four 
  4978. user bytes.  ATPSocket contains the socket number from which the response should 
  4979. be sent.  The end-of-message flag in atpFlags should be set if this response packet 
  4980. is the final packet in a transaction composed of a group of packets and the number 
  4981. of responses is less than requested.  AddrBlock indicates the socket to which the 
  4982. response should be sent.  ReqLength and reqPointer contain the size (in bytes) and 
  4983. location of the response to send; rspNum indicates the sequence number of the 
  4984. response (in the range 0 to 7).  TransID must contain the transaction ID.
  4985.  
  4986. Warning:  If the transaction is part of an exactly-once transaction, the buffer 
  4987.           used in the AddResponse call must not be altered or released until the 
  4988.           corresponding SendResponse call has completed. 
  4989.  
  4990. Result codes    
  4991.  
  4992.       noErr           No error
  4993.       badATPSkt       Bad responding socket
  4994.       noSendResp      AddResponse issued before SendResponse
  4995.       badBuffNum      Sequence number out of range
  4996.       noDataArea      Too many outstanding ATP calls
  4997.  
  4998. æKY PRelTCB
  4999. æFc AppleTalk.h
  5000. æT Function
  5001. æD pascal OSErr PRelTCB(ATPPBPtr thePBPtr,Boolean async); 
  5002. æDT OSErr myVariable = PRelTCB((ATPPBPtr) thePBPtr,(Boolean) async);
  5003. æRI II-319,V-513
  5004. æC RelTCB function
  5005.  
  5006. Parameter block
  5007.  
  5008.     ->  26  csCode        word           ;always relTCB
  5009.     ->  30  addrBlock     long word      ;destination of request
  5010.     ->  46  transID       word           ;transaction ID of request
  5011.  
  5012. RelTCB dequeues the specified SendRequest call and returns the result code 
  5013. reqAborted for the aborted call.  The transaction ID can be obtained from the reqTID 
  5014. field of the SendRequest queue entry; see the description of SendRequest for details.
  5015.  
  5016. Result codes    
  5017.  
  5018.    noErr            No error
  5019.    cbNotFound       ATP control block not found
  5020.    noDataArea       Too many outstanding ATP calls
  5021.  
  5022. æKY PRelRspCB
  5023. æFc AppleTalk.h
  5024. æT Function
  5025. æD pascal OSErr PRelRspCB(ATPPBPtr thePBPtr,Boolean async); 
  5026. æDT OSErr myVariable = PRelRspCB((ATPPBPtr) thePBPtr,(Boolean) async);
  5027. æRI II-319,V-514
  5028. æC RelRspCB function
  5029.  
  5030. Parameter block
  5031.  
  5032.     ->  26  csCode        word          ;always relRspCB
  5033.     ->  28  atpSocket     byte          ;socket number that request was received on
  5034.     ->  30  addrBlock     long word     ;source of request
  5035.     ->  46  transID       word          ;transaction ID of request
  5036.  
  5037. In an exactly-once transaction, RelRspCB cancels the specified SendResponse, 
  5038. without waiting for the release timer to expire or a TRel packet to be received.  No 
  5039. error is returned for the SendResponse call.  Whan called to cancel a transaction 
  5040. that isn't using exactly-once service, RelRspCB returns cbNotFound.  The 
  5041. transaction ID can be obtained from the reqTID field of the SendResponse queue 
  5042. entry; see the description of SendResponse for details.
  5043.  
  5044. Result codes    
  5045.  
  5046.    noErr            No error
  5047.    cbNotFound       ATP control block not found
  5048.  
  5049. æKY PNSendRequest
  5050. æFc AppleTalk.h
  5051. æT Function
  5052. æD pascal OSErr PNSendRequest(ATPPBPtr thePBPtr,Boolean async); 
  5053. æDT OSErr myVariable = PNSendRequest((ATPPBPtr) thePBPtr,(Boolean) async);
  5054. æRI V-516
  5055. æC  
  5056. »Sending an ATP Request Through a Specified Socket
  5057.  
  5058. ATP requests can now be sent through client-specified sockets.  ATP previously would
  5059. open a dynamic socket, send the request through it, and close the socket when the
  5060. request was completed.  The client can now choose to send a request through an already-opened
  5061. socket; this also allows more than one request to be sent per socket.   A new call,
  5062. PNSendRequest, has been added for this purpose.  The function of the old SendRequest
  5063. call itself remains unchanged.
  5064.  
  5065. FUNCTION PNSendRequest (thePBptr: ATPBPtr; async: BOOLEAN) : OSErr;
  5066.  
  5067. Parameter block
  5068.   -->    18    userData     longword  User bytes
  5069.   <--    22    reqTID       word      Transaction ID used in request
  5070.   -->    26    csCode       word      Always sendRequest
  5071.   <->    28    atpSocket    byte      Socket to send request on
  5072.                                        or current bitmap
  5073.   <->    29    atpFlags     byte      Control information
  5074.   -->    30    addrBlock    longword  Destination socket address
  5075.   -->    34    reqLength    word      Request size in bytes
  5076.   -->    36    reqPointer   pointer   Pointer to request data
  5077.   -->    40    bdsPointer   pointer   Pointer to response BDS
  5078.   -->    44    numOfBuffs   byte      Number of responses expected
  5079.   -->    45    timeOutVal   byte      Timeout interval
  5080.   <--    46    numOf Resps  byte      Number of responses received
  5081.   <->    47    retryCount   byte      Number of retries
  5082.   <--    48    intBuff      word      Used internally
  5083.  
  5084. The PNSendRequest call is functionally equivalent to the SendRequest call, however
  5085. PNSendRequest allows you to specify, in the atpSocket field, the socket through which
  5086. the request is to be sent.  This socket must have been previously opened through an
  5087. OpenATPSkt request (otherwise a badATPSkt error will be returned).  Note that PNSendRequest
  5088. requires two additional bytes of memory at the end of the parameter block, immediately
  5089. following the retryCount.  These bytes are for the internal use of the AppleTalk
  5090. Manager and should not be modified while the PNSendRequest call is active.
  5091.  
  5092. There is a machine-dependent limit as to the number of concurrent PNSendRequests that
  5093. can be active on a given socket.  If this limit is exceeded, the error tooManyReqs is
  5094. returned.
  5095.  
  5096. One additional difference between SendRequest and PNSendRequest is that a PNSendRequest
  5097. can only be aborted by a PKillSendReq call (see below), whereas a SendRequest can be
  5098. aborted by either a RelTCB or KillSendReq call.
  5099.  
  5100. Result Codes    noErr          No error
  5101.                 reqFailed      Retry count exceeded
  5102.                 tooManyReqs    Too many concurrent requests
  5103.                 noDataArea     Too many outstanding ATP calls
  5104.                 reqAborted     Request cancelled by user
  5105.  
  5106. æKY PKillSendReq
  5107. æFc AppleTalk.h
  5108. æT Function
  5109. æD pascal OSErr PKillSendReq(ATPPBPtr thePBPtr,Boolean async); 
  5110. æDT OSErr myVariable = PKillSendReq((ATPPBPtr) thePBPtr,(Boolean) async);
  5111. æRI V-517
  5112. æC  
  5113. »Aborting ATP SendRequests
  5114.  
  5115. The  RelTCB call is still supported, but only for aborting SendRequests.  To abort
  5116. PNSendRequests, a new call, PKillSendReq, has been added.  This call will abort both
  5117. SendRequests and PNSendRequests.  PKillSendReq’s only argument is the queue element
  5118. pointer of the request to be aborted.  The queue element pointer is passed at the
  5119. offset of the PKillSendReq queue element specified by aKillQE1.
  5120.  
  5121. FUNCTION PKillSendReq (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr;
  5122.  
  5123. Parameter block
  5124.   -->    26    csCode    word     Always PKillSendReq
  5125.   -->    44    aKillQEl  pointer  Pointer to queue element
  5126.  
  5127. PKillSendReq is functionally equivalent to RelTCB, except that it takes different
  5128. arguments and will abort both SendRequests and PNSendRequests.  To abort one of these
  5129. calls, place a pointer to the queue element of the call to abort in aKillQEl and
  5130. issue the PKillSendReq call.
  5131.  
  5132. Result Codes    noErr          No error
  5133.                 cbNotFound     aKillQEl does not point to a SendReq
  5134.                                or NSendReq queue element
  5135.  
  5136. æKY PKillGetReq
  5137. æFc AppleTalk.h
  5138. æT Function
  5139. æD pascal OSErr PKillGetReq(ATPPBPtr thePBPtr,Boolean async); 
  5140. æDT OSErr myVariable = PKillGetReq((ATPPBPtr) thePBPtr,(Boolean) async);
  5141. æRI V-518
  5142. æC  
  5143. »Aborting ATP GetRequests
  5144.  
  5145. ATP GetRequests can now be aborted through the PKillGetReq call.  This call looks and
  5146. works just like the PKillSendReq call, and is used to abort a specific GetRequest
  5147. call.  Previously it was necessary to close the socket  to abort all GetRequest calls
  5148. on the socket.
  5149.  
  5150. FUNCTION PKillGetReq (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr;
  5151.  
  5152. Parameter block
  5153.   -->    26    csCode    word     Always PKillGetReq
  5154.   -->    44    aKillQEl  pointer  Pointer to queue element
  5155.  
  5156. PKillGetReq will abort a specific outstanding GetRequest call (as opposed to closing
  5157. the socket, which aborts all outstanding GetRequests on that socket).  The call will
  5158. be completed with a reqAborted error.  To abort a GetRequest, place a pointer to the
  5159. queue element of the call to abort in aKillQEl and issue the PKillGetReq call.
  5160.  
  5161. Result Codes    noErr         No error
  5162.                 cbNotFound    aKillQEl does not point to a GetReq
  5163.                               queue element
  5164.  
  5165. æKY PKillAllGetReq
  5166. æFc AppleTalk.h
  5167. æT Function
  5168. æD 
  5169. pascal OSErr PKillAllGetReq(ATPPBPtr thePBPtr,Boolean async); 
  5170. æDT OSErr myVariable = PKillAllGetReq((ATPPBPtr) thePBPtr,(Boolean) async);
  5171. æRI V-518
  5172. æC  
  5173. »Aborting ATP GetRequests
  5174.  
  5175. ATP GetRequests can now be aborted through the PKillGetReq call.  This call looks and
  5176. works just like the PKillSendReq call, and is used to abort a specific GetRequest
  5177. call.  Previously it was necessary to close the socket  to abort all GetRequest calls
  5178. on the socket.
  5179.  
  5180. FUNCTION PKillGetReq (thePBptr: ATPPBPtr; async: BOOLEAN) : OSErr;
  5181.  
  5182. Parameter block
  5183.   -->    26    csCode    word     Always PKillGetReq
  5184.   -->    44    aKillQEl  pointer  Pointer to queue element
  5185.  
  5186. PKillGetReq will abort a specific outstanding GetRequest call (as opposed to closing
  5187. the socket, which aborts all outstanding GetRequests on that socket).  The call will
  5188. be completed with a reqAborted error.  To abort a GetRequest, place a pointer to the
  5189. queue element of the call to abort in aKillQEl and issue the PKillGetReq call.
  5190.  
  5191. Result Codes    noErr         No error
  5192.                 cbNotFound    aKillQEl does not point to a GetReq
  5193.                               queue element
  5194.  
  5195. æKY BuildLAPwds
  5196. æFc AppleTalk.h
  5197. æT Function
  5198. æD pascal void BuildLAPwds(Ptr wdsPtr,Ptr dataPtr,short destHost,short prototype,
  5199.     short frameLen); 
  5200. æDT BuildLAPwds((Ptr) wdsPtr,(Ptr) dataPtr,(short) destHost,(short) prototype,()
  5201.     short frameLen);
  5202. æRI V-514
  5203. æC 
  5204. This routine builds a single-frame write data structure LAP WDS for use with the
  5205. PWriteLAP call.  Given a buffer of length frameLen pointed to by dataPtr, it fills in
  5206. the WDS pointed to by wdsPtr and sets the destination node and protocol type as
  5207. indicated by destHost and protoType, respectively.  The WDS indicated must contain at
  5208. least two elements.
  5209.  
  5210. æKY BuildDDPwds
  5211. æFc AppleTalk.h
  5212. æT Function
  5213. æD pascal void BuildDDPwds(Ptr wdsPtr,Ptr headerPtr,Ptr dataPtr,const AddrBlock netAddr,
  5214.     short ddpType,short dataLen); 
  5215. æDT BuildDDPwds((Ptr) wdsPtr,(Ptr) headerPtr,(Ptr) dataPtr,(const AddrBlock) netAddr,()
  5216.     short ddpType,(short) dataLen);
  5217. æRI V-514
  5218. æC 
  5219. This routine builds a single-frame write data structure  DDP WDS, for use with the
  5220. PWriteDDP call.  Given a header buffer of at least 17 bytes pointed to by headerPtr
  5221. and a data buffer of length dataLen pointed to by dataPtr, it fills in the WDS pointed
  5222. to by wdsPtr, and sets the destination address and protocol type as indicated by
  5223. destaddress and DDPtype, respectively.  The WDS indicated must contain at least 3
  5224. elements.
  5225.  
  5226. æKY NBPSetEntity
  5227. æFc AppleTalk.h
  5228. æT Function
  5229. æD pascal void NBPSetEntity(Ptr buffer,Ptr nbpObject,Ptr nbpType,Ptr nbpZone); 
  5230. æDT NBPSetEntity((Ptr) buffer,(Ptr) nbpObject,(Ptr) nbpType,(Ptr) nbpZone);
  5231. æRI V-514
  5232. æC 
  5233. This routine builds an NBP entity structure, for use with the PLookupNBP and PConfirmName
  5234. calls.  Given a buffer of at least the size of the EntityName data structure (99
  5235. bytes) pointed to by buffer, this routine sets the indicated object, type, and zone
  5236. in that buffer.
  5237.  
  5238. æKY NBPSetNTE
  5239. æFc AppleTalk.h
  5240. æT Function
  5241. æD pascal void NBPSetNTE(Ptr ntePtr,Ptr nbpObject,Ptr nbpType,Ptr nbpZone,
  5242.     short socket); 
  5243. æDT NBPSetNTE((Ptr) ntePtr,(Ptr) nbpObject,(Ptr) nbpType,(Ptr) nbpZone,()
  5244.     short socket);
  5245. æRI V-515
  5246. æC 
  5247. This routine builds an NBP names table entry, for use with the PRegisterName call. 
  5248. Given a names table entry of at least the size of the EntityName data structure plus
  5249. nine bytes (108 bytes) pointed to by ntePtr, this routine sets the indicated object,
  5250. type, zone, and socket in that names table entry.
  5251.  
  5252. æKY GetBridgeAddress
  5253. æFc AppleTalk.h
  5254. æT Function
  5255. æD pascal short GetBridgeAddress(void); 
  5256. æDT short myVariable = GetBridgeAddress()(void);
  5257. æRT 132
  5258. æRI V-515, N132-2
  5259. æC 
  5260. This routine returns the current address of a bridge in the low byte, or zero if
  5261. there is none.
  5262.  
  5263. æKY BuildBDS
  5264. æFc AppleTalk.h
  5265. æT Function
  5266. æD pascal short BuildBDS(Ptr buffPtr,Ptr bdsPtr,short buffSize); 
  5267. æDT short myVariable = BuildBDS((Ptr) buffPtr,(Ptr) bdsPtr,(short) buffSize);
  5268. æRI V-515
  5269. æC 
  5270. This routine builds a BDS, for use with the ATP calls.  Given a data buffer of length
  5271. buffSize pointed to by buffPtr, it fills in the BDS pointed to by bdsPtr.  The buffer
  5272. will be broken up into pieces of maximum size (578 bytes).  The user bytes in the BDS
  5273. are not modified by this routine.  This routine is provided only as a convenience;
  5274. generally the caller will be able to build the BDS completely from Pascal without
  5275. it.
  5276.  
  5277. æKY MPPOpen
  5278. æFc AppleTalk.h
  5279. æT Function
  5280. æD pascal OSErr MPPOpen(void); 
  5281. æDT OSErr myVariable = MPPOpen()(void);
  5282. æMM
  5283. æRT 224
  5284. æRI II-275
  5285. æC 
  5286. MPPOpen first checks whether the .MPP driver has already been loaded; if it has,
  5287. MPPOpen does nothing and returns noErr. If MPP hasn’t been loaded, MPPOpen attempts
  5288. to load it into the system heap. If it succeeds, it then initializes the driver’s
  5289. variables and goes through the process of dynamically assigning a node ID to that
  5290. Macintosh. On a Macintosh 512K or XL, it also loads the .ATP driver and NBP code into
  5291. the system heap.
  5292.  
  5293. If serial port B isn’t configured for AppleTalk, or is already in use, the .MPP
  5294. driver isn’t loaded and an appropriate result code is returned.
  5295.  
  5296. Result codes    noErr        No error
  5297.                 portInUse    Port B is already in use
  5298.                 portNotCf    Port B not configured for AppleTalk
  5299.  
  5300. æKY MPPClose
  5301. æFc AppleTalk.h
  5302. æT Function
  5303. æD pascal OSErr MPPClose(void); 
  5304. æDT OSErr myVariable = MPPClose()(void);
  5305. æMM
  5306. æRI II-275
  5307. æC 
  5308. MPPClose removes the .MPP driver, and any data structures associated with it, from
  5309. memory. If the .ATP driver or NBP code were also installed, they’re removed as well.
  5310. MPPClose also returns the use of port B to the Serial Driver.
  5311.  
  5312. Warning:  Since other co-resident programs may be using AppleTalk, it’s
  5313.           strongly recommended that you never use this call. MPPClose will
  5314.           completely disable AppleTalk; the only way to restore AppleTalk
  5315.           is to call MPPOpen again.
  5316.  
  5317. æKY LAPOpenProtocol
  5318. æFc AppleTalk.h
  5319. æT Function
  5320. æD pascal OSErr LAPOpenProtocol(ABByte theLAPType,Ptr protoPtr); 
  5321. æDT OSErr myVariable = LAPOpenProtocol((ABByte) theLAPType,(Ptr) protoPtr);
  5322. æMM
  5323. æRI II-277
  5324. æC 
  5325. LAPOpenProtocol adds the ALAP protocol type specified by theLAPType to the
  5326. node’s protocol table. If you provide a pointer to a protocol handler in protoPtr,
  5327. ALAP will send each frame with an ALAP protocol type of theLAPType to that protocol
  5328. handler.
  5329.  
  5330. If protoPtr is NIL, the default protocol handler will be used for receiving frames
  5331. with an ALAP protocol type of theLAPType. In this case, to receive a frame you must
  5332. call LAPRead to provide the default protocol handler with a buffer for placing the
  5333. data. If, however, you’ve written your own protocol handler and protoPtr points to
  5334. it, your protocol handler will have the responsibility for receiving the frame and
  5335. it’s not necessary to call LAPRead.
  5336.  
  5337. Result codes    noErr         No error
  5338.                 lapProtErr    Error attaching protocol type
  5339.  
  5340. æKY LAPCloseProtocol
  5341. æFc AppleTalk.h
  5342. æT Function
  5343. æD pascal OSErr LAPCloseProtocol(ABByte theLAPType); 
  5344. æDT OSErr myVariable = LAPCloseProtocol((ABByte) theLAPType);
  5345. æMM
  5346. æRI II-277
  5347. æC 
  5348. LAPCloseProtocol removes from the node’s protocol table the specified ALAP protocol
  5349. type, as well as its protocol handler.
  5350.  
  5351. Warning:  Don’t close ALAP protocol type values 1 or 2. If you close these
  5352.           protocol types, DDP will be disabled; once disabled, the only way
  5353.           to restore DDP is to restart the system, or to close and then
  5354.           reopen AppleTalk.
  5355.  
  5356. Result codes    noErr         No error
  5357.                 lapProtErr    Error detaching protocol type
  5358.  
  5359. æKY LAPWrite
  5360. æFc AppleTalk.h
  5361. æT Function
  5362. æD pascal OSErr LAPWrite(ATLAPRecHandle abRecord,Boolean async); 
  5363. æDT OSErr myVariable = LAPWrite((ATLAPRecHandle) abRecord,(Boolean) async);
  5364. æMM
  5365. æRI II-277
  5366. æC 
  5367. ABusRecord
  5368.   <--    abOpcode                {always tLAPWrite}
  5369.   <--    abResult                {result code}
  5370.   -->    abUserReference         {for your use}
  5371.   -->    lapAddress.dstNodeID    {destination node ID}
  5372.   -->    lapAddress.lapProtType  {ALAP protocol type}
  5373.   -->    lapReqCount             {length of frame data}
  5374.   -->    lapDataPtr              {pointer to frame data}
  5375.  
  5376. LAPWrite sends a frame to another node. LAPReqCount and lapDataPtr specify the length
  5377. and location of the data to send. The lapAddress.lapProtType field indicates the ALAP
  5378. protocol type of the frame and the lapAddress.dstNodeID indicates the node ID of the
  5379. node to which the frame should be sent.
  5380.  
  5381. Note:  The first two bytes of an ALAP frame’s data must contain the length
  5382.        in bytes of that data, including the length bytes themselves.
  5383.  
  5384. Result codes    noErr            No error
  5385.                 excessCollsns    Unable to contact destination node;
  5386.                                  packet not sent
  5387.                 ddpLenErr        ALAP data length too big
  5388.                 lapProtErr       Invalid ALAP protocol type
  5389.  
  5390. æKY LAPRead
  5391. æFc AppleTalk.h
  5392. æT Function
  5393. æD pascal OSErr LAPRead(ATLAPRecHandle abRecord,Boolean async); 
  5394. æDT OSErr myVariable = LAPRead((ATLAPRecHandle) abRecord,(Boolean) async);
  5395. æMM
  5396. æRI II-278
  5397. æC  
  5398. ABusRecord
  5399.   <--    abOpcode                {always tLAPRead}
  5400.   <--    abResult                {result code}
  5401.   -->    abUserReference         {for your use}
  5402.   <--    lapAddress.dstNodeID    {destination node ID}
  5403.   <--    lapAddress.srcNodeID    {source node ID}
  5404.   -->    lapAddress.lapProtType  {ALAP protocol type}
  5405.   -->    lapReqCount             {buffer size in bytes}
  5406.   <--    lapActCount             {number of frame data bytes actually received}
  5407.   -->    lapDataPtr              {pointer to buffer}
  5408.  
  5409. LAPRead receives a frame from another node. LAPReqCount and lapDataPtr specify the
  5410. size and location of the buffer that will receive the frame data. If the buffer isn’t
  5411. large enough to hold all of the incoming frame data, the extra bytes will be discarded
  5412. and buf2SmallErr will be returned. The number of bytes actually received is returned
  5413. in lapActCount. Only frames with ALAP protocol type equal to lapAddress.lapProtType
  5414. will be received. The node IDs of the frame’s source and destination nodes are returned
  5415. in lapAddress.srcNodeID and lapAddress.dstNodeID. You can determine whether the
  5416. packet was broadcast to you by examining the value of lapAddress.dstNodeID—if the
  5417. packet was broadcast it’s equal to 255, otherwise it’s equal to your node ID.
  5418.  
  5419. Note:  You should issue LAPRead calls only for ALAP protocol types that were
  5420.        opened (via LAPOpenProtocol) to use the default protocol handler.
  5421.  
  5422. Warning:  If you close a protocol type for which there are still LAPRead
  5423.           calls pending, the calls will be canceled but the memory occupied
  5424.           by their ABusRecords will not be released. For this reason, before
  5425.           closing a protocol type, call LAPRdCancel to cancel any pending
  5426.           LAPRead calls associated with that protocol type.
  5427.  
  5428. Result codes    noErr           No error
  5429.                 buf2SmallErr    Frame too large for buffer
  5430.                 readQErr        Invalid protocol type or protocol type not
  5431.                                 found in table
  5432.  
  5433. æKY LAPRdCancel
  5434. æFc AppleTalk.h
  5435. æT Function
  5436. æD pascal OSErr LAPRdCancel(ATLAPRecHandle abRecord); 
  5437. æDT OSErr myVariable = LAPRdCancel((ATLAPRecHandle) abRecord);
  5438. æMM
  5439. æRI II-279
  5440. æC 
  5441. Given the handle to the ABusRecord of a previously made LAPRead call, LAPRdCancel
  5442. dequeues the LAPRead call, provided that a packet satisfying the LAPRead has not
  5443. already arrived. LAPRdCancel returns noErr if the LAPRead call is successfully removed
  5444. from the queue. If LAPRdCancel returns recNotFnd, check the abResult field to verify
  5445. that the LAPRead has been completed and determine its outcome.
  5446.  
  5447. Result codes    noErr        No error
  5448.                 readQErr     Invalid protocol type or protocol type not
  5449.                              found in table
  5450.                 recNotFnd    ABRecord not found in queue
  5451.  
  5452. »Example
  5453.  
  5454. This example sends an ALAP packet synchronously and waits asynchronously for a response.
  5455. Assume that both nodes are using a known protocol type (in this case, 73) to receive
  5456. packets, and that the destination node has a node ID of 4.
  5457.  
  5458. VAR
  5459.   myABRecord: ABRecHandle;
  5460.   myBuffer: PACKED ARRAY [0..599] OF CHAR; {buffer for both send and receive}
  5461.   myLAPType: Byte;
  5462.   errCode, index, dataLen: INTEGER;
  5463.   someText: Str255;
  5464.   async: BOOLEAN;
  5465.  
  5466. BEGIN
  5467.   errCode := MPPOpen;
  5468.   IF errCode <> noErr THEN
  5469.     WRITELN('Error in opening AppleTalk')
  5470.     {Maybe serial port B isn't available for use by AppleTalk}
  5471.   ELSE
  5472.     BEGIN
  5473.     {Call Memory Manager to allocate ABusRecord}
  5474.     myABRecord := ABRecHandle(NewHandle(lapSize));
  5475.     myLAPType := 73;
  5476.    {Enter myLAPType into protocol handler table and install default handler to }
  5477.     { service frames of that ALAP type. No packets of that ALAP type will be }
  5478.     { received until we call LAPRead.}
  5479.     errCode := LAPOpenProtocol(myLAPType, NIL);
  5480.     IF errCode <> noErr THEN
  5481.       WRITELN('Error while opening the protocol type')
  5482.       {Have we opened too many protocol types? Remember that DDP uses two of }
  5483.       { them.}
  5484.     ELSE
  5485.       BEGIN
  5486.       {Prepare data to be sent}
  5487.       someText := 'This data will be in the ALAP data area';
  5488.       {The .MPP implementation requires that the first two bytes of the ALAP }
  5489.       { data field contain the length of the data, including the length bytes }
  5490.       { themselves.}
  5491.       dataLen := LENGTH(someText) + 2;
  5492.       buffer[0] := CHR(dataLen DIV 256); {high byte of data length}
  5493.       buffer[1] := CHR(dataLen MOD 256); {low byte of data length}
  5494.       FOR index := 1 TO dataLen - 2 DO {stuff buffer with packet data}
  5495.         buffer[index + 1] := someText[index];
  5496.       async := FALSE;
  5497.       WITH myABRecord^^ DO {fill parameters in the ABusRecord}
  5498.         BEGIN
  5499.         lapAddress.lapProtType := myLAPType;
  5500.         lapAddress.dstNodeID := 4;
  5501.         lapReqCount := dataLen;
  5502.         lapDataPtr := @buffer;
  5503.         END;
  5504.       {Send the frame}
  5505.       errCode := LAPWrite(myABRecord, async);
  5506.       {In the case of a sync call, errCode and the abResult field of }
  5507.       { the myABRecord will contain the same result code. We can also }
  5508.       { reuse myABRecord, since we know whether the call has completed.}
  5509.       IF errCode <> noErr THEN
  5510.         WRITELN('Error while writing out the packet')
  5511.         {Maybe the receiving node wasn't on-line}
  5512.       ELSE
  5513.         BEGIN
  5514.         {We have sent out the packet and are now waiting for a response. We }
  5515.         { issue an async LAPRead call so that we don't “hang” waiting for a }
  5516.         { response that may not come.}
  5517.         async := TRUE;
  5518.         WITH myABRecord^^ DO
  5519.           BEGIN
  5520.           lapAddress.lapProtType := myLAPType;
  5521.           {ALAP type we want to receive }
  5522.           lapReqCount := 600; {our buffer is maximum size}
  5523.           lapDataPtr := @buffer;
  5524.           END;
  5525.         errCode := LAPRead(myABRecord, async); {wait for a packet}
  5526.         IF errCode <> noErr THEN
  5527.           WRITELN('Error while trying to queue up a LAPRead')
  5528.           {Was the protocol handler installed correctly?}
  5529.         ELSE
  5530.           BEGIN
  5531.           {We can either sit here in a loop and poll the abResult }
  5532.           { field or just exit our code and use the event }
  5533.           { mechanism to flag us when the packet arrives.}
  5534.           CheckForMyEvent; {your procedure for checking for a network event}
  5535.           errCode := LAPCloseProtocol(myLAPType);
  5536.           IF errCode <> noErr THEN
  5537.             WRITELN('Error while closing the protocol type');
  5538.           END;
  5539.         END;
  5540.       END;
  5541.     END;
  5542. END.
  5543.  
  5544. æKY DDPOpenSocket
  5545. æFc AppleTalk.h
  5546. æT Function
  5547. æD pascal OSErr DDPOpenSocket(short *theSocket,Ptr sktListener); 
  5548. æDT OSErr myVariable = DDPOpenSocket((short *) theSocket,(Ptr) sktListener);
  5549. æMM
  5550. æRI II-282
  5551. æC 
  5552. DDPOpenSocket adds a socket and its socket listener to the socket table. If theSocket
  5553. is nonzero, it must be in the range 64 to 127, and it specifies the socket’s number;
  5554. if theSocket is 0, DDPOpenSocket dynamically assigns a socket number in the range 128
  5555. to 254, and returns it in theSocket. SktListener contains a pointer to the socket
  5556. listener; if it’s NIL, the default listener will be used.
  5557.  
  5558. If you’re using the default socket listener, you must then call DDPRead to receive a
  5559. datagram (in order to specify buffer space for the default socket listener). If,
  5560. however, you’ve written your own socket listener and sktListener points to it, your
  5561. listener will provide buffers for receiving datagrams and you shouldn’t use DDPRead
  5562. calls.
  5563.  
  5564. DDPOpenSocket will return ddpSktErr if you pass the number of an already opened
  5565. socket, if you pass a socket number greater than 127, or if the socket table is
  5566. full.
  5567.  
  5568. Note:  The range of static socket numbers 1 through 63 is reserved by Apple
  5569.        for internal use. Socket numbers 64 through 127 are available for
  5570.        unrestricted experimental use.
  5571.  
  5572. Result codes    noErr        No error
  5573.                 ddpSktErr    Socket error
  5574.  
  5575. æKY DDPCloseSocket
  5576. æFc AppleTalk.h
  5577. æT Function
  5578. æD pascal OSErr DDPCloseSocket(short theSocket); 
  5579. æDT OSErr myVariable = DDPCloseSocket((short) theSocket);
  5580. æMM
  5581. æRI II-282
  5582. æC 
  5583. DDPCloseSocket removes the entry of the specified socket from the socket table and
  5584. cancels all pending DDPRead calls that have been made for that socket. If you pass a
  5585. socket number of 0, or if you attempt to close a socket that isn’t open, DDPCloseSocket
  5586. will return ddpSktErr.
  5587.  
  5588. Result codes    noErr        No error
  5589.                 ddpSktErr    Socket error
  5590.  
  5591. æKY DDPRead
  5592. æFc AppleTalk.h
  5593. æT Function
  5594. æD pascal OSErr DDPRead(ATDDPRecHandle abRecord,Boolean retCksumErrs,Boolean async); 
  5595. æDT OSErr myVariable = DDPRead((ATDDPRecHandle) abRecord,(Boolean) retCksumErrs,(Boolean) async);
  5596. æMM
  5597. æRI II-283
  5598. æC 
  5599. ABusRecord
  5600.   <--    abOpcode         {always tDDPRead}
  5601.   <--    abResult         {result code}
  5602.   -->    abUserReference  {for your use}
  5603.   <--    ddpType          {DDP protocol type}
  5604.   -->    ddpSocket        {listening socket number}
  5605.   <--    ddpAddress       {source socket address}
  5606.   -->    ddpReqCount      {buffer size in bytes}
  5607.   <--    ddpActCount      {number of bytes actually received}
  5608.   -->    ddpDataPtr       {pointer to buffer}
  5609.   <--    ddpNodeID        {original destination node ID}
  5610.  
  5611. DDPRead receives a datagram from another socket. The size and location of the buffer
  5612. that will receive the data are specified by ddpReqCount and ddpDataPtr. If the buffer
  5613. isn’t large enough to hold all of the incoming frame data, the extra bytes will be
  5614. discarded and buf2SmallErr will be returned. The number of bytes actually received is
  5615. returned in ddpActCount. DDPSocket specifies the socket to receive the datagram (the
  5616. “listening” socket). The node to which the packet was sent is returned in ddpNodeID;
  5617. if the packet was broadcast ddpNodeID will contain 255. The address of the socket
  5618. that sent the packet is returned in ddpAddress. If retCksumErrs is FALSE, DDPRead
  5619. will discard any packets received with an invalid checksum and inform the caller of
  5620. the error. If retCksumErrs is TRUE, DDPRead will deliver all packets, whether or not
  5621. the checksum is valid; it will also notify the caller when there’s a checksum error.
  5622.  
  5623. Note:  The sender of the datagram must be in a different node from the
  5624.        receiver. You should issue DDPRead calls only for receiving datagrams
  5625.        for sockets opened with the default socket listener; see the
  5626.        description of DDPOpenSocket.
  5627.  
  5628. Note:  If the buffer provided isn’t large enough to hold all of the incoming
  5629.        frame data (buf2SmallErr), the checksum can’t be calculated; in this
  5630.        case, DDPRead will deliver packets even if retCksumErrs is FALSE.
  5631.  
  5632. Result codes    noErr           No error
  5633.                 buf2SmallErr    Datagram too large for buffer
  5634.                 cksumErr        Checksum error
  5635.                 ddpLenErr       Datagram length too big
  5636.                 ddpSktErr       Socket error
  5637.                 readQErr        Invalid socket or socket not found in table
  5638.  
  5639. æKY DDPWrite
  5640. æFc AppleTalk.h
  5641. æT Function
  5642. æD pascal OSErr DDPWrite(ATDDPRecHandle abRecord,Boolean doChecksum,Boolean async); 
  5643. æDT OSErr myVariable = DDPWrite((ATDDPRecHandle) abRecord,(Boolean) doChecksum,(Boolean) async);
  5644. æMM
  5645. æRI II-283
  5646. æC  
  5647. ABusRecord
  5648.   <--    abOpcode         {always tDDPWrite}
  5649.   <--    abResult         {result code}
  5650.   -->    abUserReference  {for your use}
  5651.   -->    ddpType          {DDP protocol type}
  5652.   -->    ddpSocket        {source socket number}
  5653.   -->    ddpAddress       {destination socket address}
  5654.   -->    ddpReqCount      {length of datagram data}
  5655.   -->    ddpDataPtr       {pointer to buffer}
  5656.  
  5657. DDPWrite sends a datagram to another socket. DDPReqCount and ddpDataPtr specify the
  5658. length and location of the data to send. The ddpType field indicates the DDP protocol
  5659. type of the frame, and ddpAddress is the complete internet address of the socket to
  5660. which the datagram should be sent. DDPSocket specifies the socket from which the
  5661. datagram should be sent. Datagrams sent over the internet to a node on an AppleTalk
  5662. network different from the sending node’s network have an optional software checksum
  5663. to detect errors that might occur inside the intermediate bridges. If doChecksum is
  5664. TRUE, DDPWrite will compute this checksum; if it’s FALSE, this software checksum
  5665. feature is ignored.
  5666.  
  5667. Note:  The destination socket can’t be in the same node as the program
  5668.        making the DDPWrite call.
  5669.  
  5670. Result codes    noErr          No error
  5671.                 ddpLenErr      Datagram length too big
  5672.                 ddpSktErr      Source socket not open
  5673.                 noBridgeErr    No bridge found
  5674.  
  5675. æKY DDPRdCancel
  5676. æFc AppleTalk.h
  5677. æT Function
  5678. æD pascal OSErr DDPRdCancel(ATDDPRecHandle abRecord); 
  5679. æDT OSErr myVariable = DDPRdCancel((ATDDPRecHandle) abRecord);
  5680. æMM
  5681. æRI II-284
  5682. æC 
  5683. Given the handle to the ABusRecord of a previously made DDPRead call, DDPRdCancel
  5684. dequeues the DDPRead call, provided that a packet satisfying the DDPRead hasn’t
  5685. already arrived. DDPRdCancel returns noErr if the DDPRead call is successfully removed
  5686. from the queue. If DDPRdCancel returns recNotFnd, check the abResult field of abRecord
  5687. to verify that the DDPRead has been completed and determine its outcome.
  5688.  
  5689. Result codes    noErr        No error
  5690.                 readQErr     Invalid socket or socket not found in table
  5691.                 recNotFnd    ABRecord not found in queue
  5692.  
  5693. »Example
  5694.  
  5695. This example sends a DDP packet synchronously and waits asynchronously for a response.
  5696. Assume that both nodes are using a known socket number (in this case, 30) to receive
  5697. packets. Normally, you would want to use NBP to look up your destination’s socket
  5698. address.
  5699.  
  5700. VAR
  5701.   myABRecord: ABRecHandle;
  5702.   myBuffer: PACKED ARRAY [0..599] OF CHAR; {buffer for both send and receive}
  5703.   mySocket: Byte;
  5704.   errCode, index, dataLen: INTEGER;
  5705.   someText: Str255;
  5706.   async, retCksumErrs, doChecksum: BOOLEAN;
  5707.  
  5708. BEGIN
  5709.   errCode := MPPOpen;
  5710.   IF errCode <> noErr THEN
  5711.     WRITELN('Error in opening AppleTalk')
  5712.     {Maybe serial port B isn't available for use by AppleTalk}
  5713.   ELSE
  5714.     BEGIN
  5715.       {Call Memory Manager to allocate ABusRecord}
  5716.       myABRecord := ABRecHandle(NewHandle(ddpSize));
  5717.       mySocket := 30;
  5718.   {Add mySocket to socket table and install default socket listener to service }
  5719. { datagrams addressed to that socket. No packets addressed to mySocket will be }
  5720.       { received until we call DDPRead. }
  5721.       errCode := DDPOpenSocket(mySocket, NIL);
  5722.       IF errCode <> noErr THEN
  5723.         WRITELN('Error while opening the socket')
  5724.       {Have we opened too many socket listeners? Remember that DDP uses two of }
  5725.         { them.}
  5726.       ELSE
  5727.         BEGIN
  5728.           {Prepare data to be sent}
  5729.           someText := 'This is a sample datagram';
  5730.           dataLen := LENGTH(someText);
  5731.           FOR index := 0 TO dataLen - 1 DO {stuff buffer with packet data}
  5732.             myBuffer[index] := someText[index + 1];
  5733.           async := FALSE;
  5734.           WITH myABRecord^^ DO {fill the parameters in the ABusRecord}
  5735.             BEGIN
  5736.               ddpType := 5;
  5737.               ddpAddress.aNet := 0; {send on “our” network}
  5738.               ddpAddress.aNode := 34;
  5739.               ddpAddress.aSocket := mySocket;
  5740.               ddpReqCount := dataLen;
  5741.               ddpDataPtr := @myBuffer;
  5742.             END;
  5743.           doChecksum := FALSE;
  5744.     {If packet contains a DDP long header, compute checksum and insert it into }
  5745.           { the header.}
  5746.           errCode := DDPWrite(myABRecord, doChecksum, async); {send packet}
  5747.      {In the case of a sync call, errCode and the abResult field of myABRecord }
  5748.    { will contain the same result code. We can also reuse myABRecord, since we }
  5749.           { know whether the call has completed.}
  5750.           IF errCode <> noErr THEN
  5751.             WRITELN('Error while writing out the packet')
  5752.             {Maybe the receiving node wasn't on-line}
  5753.           ELSE
  5754.             BEGIN
  5755.            {We have sent out the packet and are now waiting for a response. We }
  5756.            { issue an async DDPRead call so that we don't “hang” waiting for a }
  5757.           { response that may not come. To cancel the async read call, we must }
  5758.               { close the socket associated with the call or call DDPRdCancel.}
  5759.               async := TRUE;
  5760.               retCksumErrs := TRUE; {return packets even if }
  5761.                                     { they have a checksum error}
  5762.               WITH myABRecord^^ DO
  5763.                 BEGIN
  5764.                   ddpSocket := mySocket;
  5765.                   ddpReqCount := 600; {our reception buffer is max size}
  5766.                   ddpDataPtr := @myBuffer;
  5767.                 END;
  5768.               {Wait for a packet asynchronously}
  5769.               errCode := DDPRead(myABRecord, retCksumErrs, async);
  5770.               IF errCode <> noErr THEN
  5771.                 WRITELN('Error while trying to queue up a DDPRead')
  5772.                 {Was the socket listener installed correctly?}
  5773.               ELSE
  5774.                 BEGIN
  5775.                   {We can either sit here in a loop and poll the }
  5776.                   { abResult field or just exit our code and use the }
  5777.                   { event mechanism to flag us when the packet arrives.}
  5778.                   CheckForMyEvent; {your procedure for checking for a }
  5779.                                    { network event}
  5780.                   {If there were no errors, a packet is inside the array }
  5781.                   { mybuffer, the length is in ddpActCount, and the }
  5782.                   { address of the sending socket is in ddpAddress. }
  5783.                   { Process the packet received here and report any errors.}
  5784.                   errCode := DDPCloseSocket(mySocket); {we're done with it}
  5785.                   IF errCode <> noErr THEN
  5786.                     WRITELN('Error while closing the socket');
  5787.                 END;
  5788.             END;
  5789.         END;
  5790.     END;
  5791. END.
  5792.  
  5793. æKY ATPLoad
  5794. æFc AppleTalk.h
  5795. æT Function
  5796. æD pascal OSErr ATPLoad(void); 
  5797. æDT OSErr myVariable = ATPLoad()(void);
  5798. æMM
  5799. æRT 20, 224
  5800. æRI II-290, N20-2
  5801. æC 
  5802. •••Refer to Technical Note #224:•••
  5803.  
  5804. ATPLoad first verifies that the .MPP driver is loaded and running. If it isn’t,
  5805. ATPLoad verifies that port B is configured for AppleTalk and isn’t in use, and then
  5806. loads MPP into the system heap.
  5807.  
  5808. ATPLoad then loads the .ATP driver, unless it’s already in memory. On a Macintosh
  5809. 128K, ATPLoad reads the .ATP driver from the system resource file into the application
  5810. heap; on a Macintosh 512K or XL, ATP is read into the system heap.
  5811.  
  5812. Note:  On a Macintosh 512K or XL, ATPLoad and MPPOpen perform essentially
  5813.        the same function.
  5814.  
  5815. Result codes    noErr        No error
  5816.                 portInUse    Port B is already in use
  5817.                 portNotCf    Port B not configured for AppleTalk
  5818.  
  5819. æKY ATPUnload
  5820. æFc AppleTalk.h
  5821. æT Function
  5822. æD pascal OSErr ATPUnload(void); 
  5823. æDT OSErr myVariable = ATPUnload()(void);
  5824. æRI II-290
  5825. æC 
  5826. ATPUnload makes the .ATP driver purgeable; the space isn’t actually released by the
  5827. Memory Manager until necessary.
  5828.  
  5829. Note:  This call applies only to a Macintosh 128K; on a Macintosh 512K
  5830.        or Macintosh XL, ATPUnload has no effect.
  5831.  
  5832. Result codes    noErr    No error
  5833.  
  5834. æKY ATPOpenSocket
  5835. æFc AppleTalk.h
  5836. æT Function
  5837. æD pascal OSErr ATPOpenSocket(const AddrBlock *addrRcvd,short *atpSocket); 
  5838. æDT OSErr myVariable = ATPOpenSocket((const AddrBlock *) addrRcvd,(short *) atpSocket);
  5839. æMM
  5840. æRI II-290
  5841. æC 
  5842. ATPOpenSocket opens a socket for the purpose of receiving requests. ATPSocket contains
  5843. the socket number of the socket to open; if it’s 0, a number is dynamically assigned
  5844. and returned in atpSocket. AddrRcvd contains a filter of the sockets from which
  5845. requests will be accepted. A 0 in the network number, node ID, or socket number field
  5846. of the addrRcvd record acts as a “wild card”; for instance, a 0 in the socket number
  5847. field means that requests will be accepted from all sockets in the node(s) specified
  5848. by the network and node fields.
  5849.  
  5850. Result codes    noErr          No error
  5851.                 tooManySkts    Socket table full
  5852.                 noDataArea     Too many outstanding ATP calls
  5853.  
  5854. Note:  If you’re only going to send requests and receive responses to
  5855.        these requests, you don’t need to open an ATP socket. When you
  5856.        make the ATPSndRequest or ATPRequest call, ATP automatically
  5857.        opens a dynamically assigned socket for that purpose.
  5858.  
  5859. æKY ATPCloseSocket
  5860. æFc AppleTalk.h
  5861. æT Function
  5862. æD pascal OSErr ATPCloseSocket(short atpSocket); 
  5863. æDT OSErr myVariable = ATPCloseSocket((short) atpSocket);
  5864. æMM
  5865. æRI II-291
  5866. æC 
  5867. ATPCloseSocket closes the responding socket whose number is specified by atpSocket.
  5868. It releases the data structures associated with all pending, asynchronous calls
  5869. involving that socket; these pending calls are completed immediately and return the
  5870. result code sktClosed.
  5871.  
  5872. Result codes    noErr         No error
  5873.                 noDataArea    Too many outstanding ATP calls
  5874.  
  5875. æKY ATPSndRequest
  5876. æFc AppleTalk.h
  5877. æT Function
  5878. æD pascal OSErr ATPSndRequest(ATATPRecHandle abRecord,Boolean async); 
  5879. æDT OSErr myVariable = ATPSndRequest((ATATPRecHandle) abRecord,(Boolean) async);
  5880. æMM
  5881. æRI II-291
  5882. æC 
  5883. ABusRecord
  5884.   <--    abOpcode         {always tATPSndRequest}
  5885.   <--    abResult         {result code}
  5886.   -->    abUserReference  {for your use}
  5887.   -->    atpAddress       {destination socket address}
  5888.   -->    atpReqCount      {request size in bytes}
  5889.   -->    atpDataPtr       {pointer to buffer}
  5890.   -->    atpRspBDSPtr     {pointer to response BDS}
  5891.   -->    atpUserData      {user bytes}
  5892.   -->    atpXO            {exactly-once flag}
  5893.   <--    atpEOM           {end-of-message flag}
  5894.   -->    atpTimeOut       {retry timeout interval in seconds}
  5895.   -->    atpRetries       {maximum number of retries}
  5896.   -->    atpNumBufs       {number of elements in response BDS}
  5897.   <--    atpNumRsp        {number of response packets actually received}
  5898.  
  5899. ATPSndRequest sends a request to another socket. ATPAddress is the internet address
  5900. of the socket to which the request should be sent. ATPDataPtr and atpReqCount specify
  5901. the location and size of a buffer that contains the request information to be sent.
  5902. ATPUserData contains the user bytes for the ATP header.
  5903.  
  5904. ATPSndRequest requires you to allocate a response BDS. ATPRspBDSPtr is a pointer to
  5905. the response BDS; atpNumBufs indicates the number of elements in the BDS (this is
  5906. also the maximum number of response datagrams that will be accepted). The number of
  5907. response datagrams actually received is returned in atpNumRsp; if a nonzero value is
  5908. returned, you can examine the response BDS to determine which packets of the transaction
  5909. were actually received. If the number returned is less than requested, one of the
  5910. following is true:
  5911.  
  5912.   •  Some of the packets have been lost and the retry count has been exceeded.
  5913.   •  ATPEOM is TRUE; this means that the response consisted of fewer packets
  5914.      than were expected, but that all packets sent were received (the last
  5915.      packet came with the atpEOM flag set).
  5916.  
  5917. ATPTimeOut indicates the length of time that ATPSndRequest should wait for a response
  5918. before retransmitting the request. ATPRetries indicates the maximum number of retries
  5919. ATPSndRequest should attempt. ATPXO should be TRUE if you want the request to be part
  5920. of an exactly-once transaction.
  5921.  
  5922. ATPSndRequest completes when either the transaction is completed or the retry count
  5923. is exceeded.
  5924.  
  5925. Result codes    noErr          No error
  5926.                 reqFailed      Retry count exceeded
  5927.                 tooManyReqs    Too many concurrent requests
  5928.                 noDataArea     Too many outstanding ATP calls
  5929.  
  5930. æKY ATPRequest
  5931. æFc AppleTalk.h
  5932. æT Function
  5933. æD pascal OSErr ATPRequest(ATATPRecHandle abRecord,Boolean async); 
  5934. æDT OSErr myVariable = ATPRequest((ATATPRecHandle) abRecord,(Boolean) async);
  5935. æMM
  5936. æRI II-292
  5937. æC 
  5938. ABusRecord
  5939.   <--    abOpcode         {always tATPRequest}
  5940.   <--    abResult         {result code}
  5941.   -->    abUserReference  {for your use}
  5942.   -->    atpAddress       {destination socket address}
  5943.   -->    atpReqCount      {request size in bytes}
  5944.   -->    atpDataPtr       {pointer to buffer}
  5945.   <--    atpActCount      {number of bytes actually received}
  5946.   -->    atpUserData      {user bytes}
  5947.   -->    atpXO            {exactly-once flag}
  5948.   <--    atpEOM           {end-of-message flag}
  5949.   -->    atpTimeOut       {retry timeout interval in seconds}
  5950.   -->    atpRetries       {maximum number of retries}
  5951.   <--    atpRspUData      {user bytes received in transaction response}
  5952.   -->    atpRspBuf        {pointer to response message buffer}
  5953.   -->    atpRspSize       {size of response message buffer}
  5954.  
  5955. ATPRequest is functionally analogous to ATPSndRequest. It sends a request to another
  5956. socket, but doesn’t require the caller to set up and use the BDS data structure to
  5957. describe the response buffers. ATPAddress indicates the socket to which the request
  5958. should be sent. ATPDataPtr and atpReqCount specify the location and size of a buffer
  5959. that contains the request information to be sent. ATPUserData contains the user bytes
  5960. to be sent in the request’s ATP header. ATPTimeOut indicates the length of time that
  5961. ATPRequest should wait for a response before retransmitting the request. ATPRetries
  5962. indicates the maximum number of retries ATPRequest should attempt.
  5963.  
  5964. To use this call, you must have an area of contiguous buffer space that’s large
  5965. enough to receive all expected datagrams. The various datagrams will be assembled in
  5966. this buffer and returned to you as a complete message upon completion of the transaction.
  5967. The location and size of this buffer are passed in atpRspBuf and atpRspSize. Upon
  5968. completion of the call, the size of the received response message is returned in
  5969. atpActCount. The user bytes received in the ATP header of the first response packet
  5970. are returned in atpRspUData. ATPXO should be TRUE if you want the request to be part
  5971. of an exactly-once transaction.
  5972.  
  5973. Although you don’t provide a BDS, ATPRequest in fact creates one and calls the
  5974. .ATP driver (as in an ATPSndRequest call). For this reason, the abRecord fields
  5975. atpRspBDSPtr and atpNumBufs are used by ATPRequest; you should not expect these
  5976. fields to remain unaltered during or after the function’s execution.
  5977.  
  5978. For ATPRequest to receive and correctly deliver the response as a single message, the
  5979. responding end must, upon receiving the request (with an ATPGetRequest call), generate
  5980. the complete response as a message in a single buffer and then call ATPResponse.
  5981.  
  5982. Note:  The responding end could also use ATPSndRsp and ATPAddRsp provided
  5983.        that each response packet (except the last one) contains exactly 578
  5984.        ATP data bytes; the last packet in the response can contain less than
  5985.        578 ATP data bytes. Also, if this method is used, only the ATP user
  5986.        bytes of the first response packet will be delivered to the requester;
  5987.        any information in the user bytes of the remaining response packets
  5988.        will not be delivered.
  5989.  
  5990. ATPRequest completes when either the transaction is completed or the retry count is
  5991. exceeded.
  5992.  
  5993. Result codes    noErr          No error
  5994.                 reqFailed      Retry count exceeded
  5995.                 tooManyReqs    Too many concurrent requests
  5996.                 sktClosed      Socket closed by a cancel call
  5997.                 noDataArea     Too many outstanding ATP calls
  5998.  
  5999. æKY ATPReqCancel
  6000. æFc AppleTalk.h
  6001. æT Function
  6002. æD pascal OSErr ATPReqCancel(ATATPRecHandle abRecord,Boolean async); 
  6003. æDT OSErr myVariable = ATPReqCancel((ATATPRecHandle) abRecord,(Boolean) async);
  6004. æMM
  6005. æRI II-293
  6006. æC 
  6007. Given the handle to the ABusRecord of a previously made ATPSndRequest or ATPRequest
  6008. call, ATPReqCancel dequeues the ATPSndRequest or ATPRequest call, provided that the
  6009. call hasn’t already completed. ATPReqCancel returns noErr if the ATPSndRequest or
  6010. ATPRequest call is successfully removed from the queue. If it returns cbNotFound,
  6011. check the abResult field of abRecord to verify that the ATPSndRequest or ATPRequest
  6012. call has completed and determine its outcome.
  6013.  
  6014. Result codes    noErr         No error
  6015.                 cbNotFound    ATP control block not found
  6016.  
  6017. æKY ATPGetRequest
  6018. æFc AppleTalk.h
  6019. æT Function
  6020. æD pascal OSErr ATPGetRequest(ATATPRecHandle abRecord,Boolean async); 
  6021. æDT OSErr myVariable = ATPGetRequest((ATATPRecHandle) abRecord,(Boolean) async);
  6022. æMM
  6023. æRT 20
  6024. æRI II-293, N20-2
  6025. æC  
  6026. ABusRecord
  6027.   <--    abOpcode         {always tATPGetRequest}
  6028.   <--    abResult         {result code}
  6029.   -->    abUserReference  {for your use}
  6030.   -->    atpSocket        {listening socket number}
  6031.   <--    atpAddress       {source socket address}
  6032.   -->    atpReqCount      {buffer size in bytes}
  6033.   -->    atpDataPtr       {pointer to buffer}
  6034.   <--    atpBitMap        {transaction bit map}
  6035.   <--    atpTransID       {transaction ID}
  6036.   <--    atpActCount      {number of bytes actually received}
  6037.   <--    atpUserData      {user bytes}
  6038.   <--    atpXO            {exactly-once flag}
  6039.  
  6040. ATPGetRequest sets up the mechanism to receive a request sent by either an ATPSndRequest
  6041. or an ATPRequest call. ATPSocket contains the socket number of the socket that should
  6042. listen for a request; this socket must already have been opened by calling ATPOpenSocket.
  6043. The address of the socket from which the request was sent is returned in atpAddress.
  6044. ATPDataPtr specifies a buffer to store the incoming request; atpReqCount indicates
  6045. the size of the buffer in bytes. The number of bytes actually received in the request
  6046. is returned in atpActCount. ATPUserData contains the user bytes from the ATP header.
  6047. The transaction bit map is returned in atpBitMap. The transaction ID is returned in
  6048. atpTransID. ATPXO will be TRUE if the request is part of an exactly-once transaction.
  6049.  
  6050. ATPGetRequest completes when a request is received. To cancel an asynchronous ATPGetRequest
  6051. call, you must call ATPCloseSocket, but this cancels all pending calls involving that
  6052. socket.
  6053.  
  6054. Result codes    noErr        No error
  6055.                 badATPSkt    Bad responding socket
  6056.                 sktClosed    Socket closed by a cancel call
  6057.  
  6058. æKY ATPSndRsp
  6059. æFc AppleTalk.h
  6060. æT Function
  6061. æD pascal OSErr ATPSndRsp(ATATPRecHandle abRecord,Boolean async); 
  6062. æDT OSErr myVariable = ATPSndRsp((ATATPRecHandle) abRecord,(Boolean) async);
  6063. æMM
  6064. æRI II-294
  6065. æC  
  6066. ABusRecord
  6067.   <--    abOpcode         {always tATPSdRsp}
  6068.   <--    abResult         {result code}
  6069.   -->    abUserReference  {for your use}
  6070.   -->    atpSocket        {responding socket number}
  6071.   -->    atpAddress       {destination socket address}
  6072.   -->    atpRspBDSPtr     {pointer to response BDS}
  6073.   -->    atpTransID       {transaction ID}
  6074.   -->    atpEOM           {end-of-message flag}
  6075.   -->    atpNumBufs       {number of response packets being sent}
  6076.   -->    atpBDSSize       {number of elements in response BDS}
  6077.  
  6078. ATPSndRsp sends a response to another socket. ATPSocket contains the socket number
  6079. from which the response should be sent and atpAddress contains the internet address
  6080. of the socket to which the response should be sent. ATPTransID must contain the
  6081. transaction ID. ATPEOM is TRUE if the response BDS contains the final packet in a
  6082. transaction composed of a group of packets and the number of packets in the response
  6083. is less than expected. ATPRspBDSPtr points to the buffer data structure containing
  6084. the responses to be sent. ATPBDSSize indicates the number of elements in the response
  6085. BDS, and must be in the range 1 to 8. ATPNumBufs indicates the number of response
  6086. packets being sent with this call, and must be in the range 0 to 8.
  6087.  
  6088. Note:  In some situations, you may want to send only part (or possibly none)
  6089.        of your response message back immediately. For instance, you might be
  6090.        requested to send back seven disk blocks, but have only enough internal
  6091.        memory to store one block. In this case, set atpBDSSize to 7 (total
  6092.        number of response packets), atpNumBufs to 0 (number of response
  6093.        packets currently being sent), and call ATPSndRsp. Then as you read
  6094.        in one block at a time, call ATPAddRsp until all seven response
  6095.        datagrams have been sent.
  6096.  
  6097. During exactly-once transactions, ATPSndRsp won’t complete until the release packet
  6098. is received or the release timer expires.
  6099.  
  6100. Result codes    noErr         No error
  6101.                 badATPSkt     Bad responding socket
  6102.                 noRelErr      No release received
  6103.                 sktClosed     Socket closed by a cancel call
  6104.                 noDataArea    Too many outstanding ATP calls
  6105.                 badBuffNum    Bad sequence number
  6106.  
  6107. æKY ATPAddRsp
  6108. æFc AppleTalk.h
  6109. æT Function
  6110. æD pascal OSErr ATPAddRsp(ATATPRecHandle abRecord); 
  6111. æDT OSErr myVariable = ATPAddRsp((ATATPRecHandle) abRecord);
  6112. æMM
  6113. æRI II-295
  6114. æC  
  6115. ABusRecord
  6116.   <--    abOpcode         {always tATPAddRsp}
  6117.   <--    abResult         {result code}
  6118.   -->    abUserReference  {for your use}
  6119.   -->    atpSocket        {responding socket number}
  6120.   -->    atpAddress       {destination socket address}
  6121.   -->    atpReqCount      {buffer size in bytes}
  6122.   -->    atpDataPtr       {pointer to buffer}
  6123.   -->    atpTransID       {transaction ID}
  6124.   -->    atpUserData      {user bytes}
  6125.   -->    atpEOM           {end-of-message flag}
  6126.   -->    atpNumRsp        {sequence number}
  6127.  
  6128. ATPAddRsp sends one additional response packet to a socket that has already been sent
  6129. the initial part of a response via ATPSndRsp. ATPSocket contains the socket number
  6130. from which the response should be sent and atpAddress contains the internet address
  6131. of the socket to which the response should be sent. ATPTransID must contain the
  6132. transaction ID. ATPDataPtr and atpReqCount specify the location and size of a buffer
  6133. that contains the information to send; atpNumRsp is the sequence number of the response.
  6134. ATPEOM is TRUE if this response datagram is the final packet in a transaction composed
  6135. of a group of packets. ATPUserData contains the user bytes to be sent in this response
  6136. datagram’s ATP header.
  6137.  
  6138. Note:  No BDS is needed with ATPAddRsp because all pertinent information
  6139.        is passed within the record.
  6140.  
  6141. Result codes    noErr         No error
  6142.                 badATPSkt     Bad responding socket
  6143.                 badBuffNum    Bad sequence number
  6144.                 noSendResp    ATPAddRsp issued before ATPSndRsp
  6145.                 noDataArea    Too many outstanding ATP calls
  6146.  
  6147. æKY ATPResponse
  6148. æFc AppleTalk.h
  6149. æT Function
  6150. æD pascal OSErr ATPResponse(ATATPRecHandle abRecord,Boolean async); 
  6151. æDT OSErr myVariable = ATPResponse((ATATPRecHandle) abRecord,(Boolean) async);
  6152. æMM
  6153. æRT 20
  6154. æRI II-296, N20-2
  6155. æC 
  6156. ABusRecord
  6157.   <--    abOpcode         {always tATPResponse}
  6158.   <--    abResult         {result code}
  6159.   -->    abUserReference  {for your use}
  6160.   -->    atpSocket        {responding socket number}
  6161.   -->    atpAddress       {destination socket address}
  6162.   -->    atpTransID       {transaction ID)
  6163.   -->    atpRspUData      {user bytes sent in transaction response}
  6164.   -->    atpRspBuf        {pointer to response message buffer}
  6165.   -->    atpRspSize       {size of response message buffer}
  6166.  
  6167. ATPResponse is functionally analogous to ATPSndRsp. It sends a response to another
  6168. socket, but doesn’t require the caller to provide a BDS. ATPAddress must contain the
  6169. complete network address of the socket to which the response should be sent (taken
  6170. from the data provided by an ATPGetRequest call). ATPTransID must contain the transaction
  6171. ID. ATPSocket indicates the socket from which the response should be sent (the socket
  6172. on which the corresponding ATPGetRequest was issued). ATPRspBuf points to the buffer
  6173. containing the response message; the size of this buffer must be passed in atpRspSize.
  6174. The four user bytes to be sent in the ATP header of the first response packet are
  6175. passed in atpRspUData. The last packet of the transaction response is sent with the
  6176. EOM flag set.
  6177.  
  6178. Although you don’t provide a BDS, ATPResponse in fact creates one and calls the .ATP
  6179. driver (as in an ATPSndRsp call). For this reason, the abRecord fields atpRspBDSPtr
  6180. and atpNumBufs are used by ATPResponse; you should not expect these fields to remain
  6181. unaltered during or after the function’s execution.
  6182.  
  6183. During exactly-once transactions ATPResponse won’t complete until the release packet
  6184. is received or the release timer expires.
  6185.  
  6186. Warning:  The maximum permissible size of the response message is 4624 bytes.
  6187.  
  6188. Result codes    noErr         No error
  6189.                 badATPSkt     Bad responding socket
  6190.                 noRelErr      No release received
  6191.                 atpLenErr     Response too big
  6192.                 sktClosed     Socket closed by a cancel call
  6193.                 noDataArea    Too many outstanding ATP calls
  6194.  
  6195. æKY ATPRspCancel
  6196. æFc AppleTalk.h
  6197. æT Function
  6198. æD pascal OSErr ATPRspCancel(ATATPRecHandle abRecord,Boolean async); 
  6199. æDT OSErr myVariable = ATPRspCancel((ATATPRecHandle) abRecord,(Boolean) async);
  6200. æMM
  6201. æRI II-296
  6202. æC 
  6203. Given the handle to the ABusRecord of a previously made ATPSndRsp or ATPResponse
  6204. call, ATPRspCancel dequeues the ATPSndRsp or ATPResponse call, provided that the call
  6205. hasn’t already completed. ATPRspCancel returns noErr if the ATPSndRsp or ATPResponse
  6206. call is successfully removed from the queue. If it returns cbNotFound, check the
  6207. abResult field of abRecord to verify that the ATPSndRsp or ATPResponse call has
  6208. completed and determine its outcome.
  6209.  
  6210. Result codes    noErr         No error
  6211.                 cbNotFound    ATP control block not found
  6212.  
  6213. »Example
  6214.  
  6215. This example shows the requesting side of an ATP transaction that asks for a 512-byte
  6216. disk block from the responding end. The block number of the file is a byte and is
  6217. contained in myBuffer[0].
  6218.  
  6219. VAR
  6220.   myABRecord: ABRecHandle;
  6221.   myBDSPtr: BDSPtr;
  6222.   myBuffer: PACKED ARRAY [0..511] OF CHAR;
  6223.   errCode: INTEGER;
  6224.   async: BOOLEAN;
  6225.  
  6226. BEGIN
  6227.   errCode := ATPLoad;
  6228.   IF errCode <> noErr THEN
  6229.     WRITELN('Error in opening AppleTalk')
  6230.     {Maybe serial port B isn't available for use by AppleTalk}
  6231.   ELSE
  6232.     BEGIN
  6233.       {Prepare the BDS; allocate space for a one-element BDS}
  6234.       myBDSPtr := BDSPtr(NewPtr(SIZEOF(BDSElement)));
  6235.       WITH myBDSPtr^[0] DO
  6236.         BEGIN
  6237.           buffSize := 512; {size of our buffer used in reception}
  6238.           buffPtr := @myBuffer; {pointer to the buffer}
  6239.         END;
  6240.       {Prepare the ABusRecord}
  6241.       myBuffer[0] := CHR(1); {requesting disk block number 1}
  6242.       myABRecord := ABRecHandle(NewHandle(atpSize));
  6243.       WITH myABRecord^^ DO
  6244.         BEGIN
  6245.           atpAddress.aNet := 0;
  6246.           atpAddress.aNode := 30; {we probably got this from an NBP call}
  6247.           atpAddress.aSocket := 15; {socket to send request to}
  6248.           atpReqCount := 1; {size of request data field (disk block #)}
  6249.           atpDataPtr := @myBuffer; {ptr to request to be sent}
  6250.           atpRspBDSPtr := @myBDSPtr;
  6251.           atpUserData := 0; {for your use}
  6252.           atpXO := FALSE; {at-least-once service}
  6253.           atpTimeOut := 5; {5-second timeout}
  6254.           atpRetries := 3; {3 retries; request will be sent 4 times max}
  6255.           atpNumBufs := 1; {we're only expecting 1 block to be returned}
  6256.         END;
  6257.       async := FALSE;
  6258.       {Send the request and wait for the response}
  6259.       errCode := ATPSndRequest(myABRecord, async);
  6260.       IF errCode <> noErr THEN
  6261.         WRITELN('An error occurred in the ATPSndRequest call')
  6262.       ELSE
  6263.         BEGIN
  6264.           {The disk block requested is now in myBuffer. We can verify }
  6265.           { that atpNumRsp contains 1, meaning one response received.}
  6266.         . . .
  6267.         END;
  6268.     END;
  6269. END.
  6270.  
  6271. æKY NBPRegister
  6272. æFc AppleTalk.h
  6273. æT Function
  6274. æD pascal OSErr NBPRegister(ATNBPRecHandle abRecord,Boolean async); 
  6275. æDT OSErr myVariable = NBPRegister((ATNBPRecHandle) abRecord,(Boolean) async);
  6276. æMM
  6277. æRT 20
  6278. æRI II-299, N20-2
  6279. æC 
  6280. ABusRecord
  6281.   <--    abOpcode            {always tNBPRegister}
  6282.   <--    abResult            {result code}
  6283.   -->    abUserReference     {for your use}
  6284.   -->    nbpEntityPtr        {pointer to entity name}
  6285.   -->    nbpBufPtr           {pointer to buffer}
  6286.   -->    nbpBufSize          {buffer size in bytes}
  6287.   -->    nbpAddress.aSocket  {socket address}
  6288.   -->    nbpRetransmitInfo   {retransmission information}
  6289.  
  6290. NBPRegister adds the name and address of an entity to the node’s names table. NBPEntityPtr
  6291. points to a variable of type EntityName containing the entity’s name. If the name is
  6292. already registered, NBPRegister returns the result code nbpDuplicate. NBPAddress
  6293. indicates the socket for which the name should be registered. NBPBufPtr and nbpBufSize
  6294. specify the location and size of a buffer for NBP to use internally.
  6295.  
  6296. While the variable of type EntityName is declared as three 32-byte strings, only the
  6297. actual characters of the name are placed in the buffer pointed to by nbpBufPtr. For
  6298. this reason, nbpBufSize needs only to be equal to the actual length of the name, plus
  6299. an additional 12 bytes for use by NBP.
  6300.  
  6301. Warning:  This buffer must not be altered or released until the name is
  6302.           removed from the names table via an NBPRemove call. If you
  6303.           allocate the buffer through a NewHandle call, you must lock
  6304.           it as long as the name is registered.
  6305.  
  6306. Warning:  The zone field of the entity name must be set to the
  6307.           meta-character “*”.
  6308.  
  6309. Result codes    noErr           No error
  6310.                 nbpDuplicate    Duplicate name already exists
  6311.  
  6312. æKY NBPLookup
  6313. æFc AppleTalk.h
  6314. æT Function
  6315. æD pascal OSErr NBPLookup(ATNBPRecHandle abRecord,Boolean async); 
  6316. æDT OSErr myVariable = NBPLookup((ATNBPRecHandle) abRecord,(Boolean) async);
  6317. æMM
  6318. æRT 9, 20
  6319. æRI II-300, N9-1, 2, N20-2 
  6320. æC 
  6321. ABusRecord
  6322.   <--    abOpcode           {always tNBPLookup}
  6323.   <--    abResult           {result code}
  6324.   -->    abUserReference    {for your use}
  6325.   -->    nbpEntityPtr       {pointer to entity name}
  6326.   -->    nbpBufPtr          {pointer to buffer}
  6327.   -->    nbpBufSize         {buffer size in bytes}
  6328.   <->    nbpDataField       {number of addresses received}
  6329.   -->    nbpRetransmitInfo  {retransmission information}
  6330.  
  6331. NBPLookup returns the addresses of all entities with a specified name. NBPEntityPtr
  6332. points to a variable of type EntityName containing the name of the entity whose
  6333. address should be returned. (Meta-characters are allowed in the entity name.) NBPBufPtr
  6334. and nbpBufSize contain the location and size of an area of memory in which the entity
  6335. names and their corresponding addresses should be returned. NBPDataField indicates
  6336. the maximum number of matching names to find addresses for; the actual number of
  6337. addresses found is returned in nbpDataField. NBPRetransmitInfo contains the retry
  6338. interval and the retry count.
  6339.  
  6340. When specifying nbpBufSize, for each NBP tuple expected, allow space for the actual
  6341. characters of the name, the address, and four bytes for use by NBP.
  6342.  
  6343. Result codes    noErr         No error
  6344.                 nbpBuffOvr    Buffer overflow
  6345.  
  6346. æKY NBPExtract
  6347. æFc AppleTalk.h
  6348. æT Function
  6349. æD pascal OSErr NBPExtract(Ptr theBuffer,short numInBuf,short whichOne,EntityName *abEntity,
  6350.     AddrBlock *address); 
  6351. æDT OSErr myVariable = NBPExtract((Ptr) theBuffer,(short) numInBuf,(short) whichOne,(EntityName *) abEntity,(
  6352.     AddrBlock) * address);
  6353. æMM
  6354. æRI II-300,V-515
  6355. æC 
  6356. This routine is provided in the alternate interface, but can be used as provided for
  6357. extracting NBP entity names from a look-up response buffer.
  6358.  
  6359. NBPExtract returns one address from the list of addresses returned by NBPLookup.
  6360. TheBuffer and numInBuf indicate the location and number of tuples in the buffer.
  6361. WhichOne specifies which one of the tuples in the buffer should be returned in the
  6362. abEntity and address parameters.
  6363.  
  6364. Result codes    noErr         No error
  6365.                 extractErr    Can’t find tuple in buffer
  6366.  
  6367. æKY NBPConfirm
  6368. æFc AppleTalk.h
  6369. æT Function
  6370. æD pascal OSErr NBPConfirm(ATNBPRecHandle abRecord,Boolean async); 
  6371. æDT OSErr myVariable = NBPConfirm((ATNBPRecHandle) abRecord,(Boolean) async);
  6372. æMM
  6373. æRT 9
  6374. æRI II-301, N9-2
  6375. æC 
  6376. ABusRecord
  6377.   <--    abOpcode           {always tNBPConfirm}
  6378.   <--    abResult           {result code}
  6379.   -->    abUserReference    {for your use}
  6380.   -->    nbpEntityPtr       {pointer to entity name}
  6381.   <--    nbpDataField       {socket number}
  6382.   -->    nbpAddress         {socket address}
  6383.   -->    nbpRetransmitInfo  {retransmission information}
  6384.  
  6385. NBPConfirm confirms that an entity known by name and address still exists (is still
  6386. entered in the names directory). NBPEntityPtr points to a variable of type EntityName
  6387. that contains the name to confirm, and nbpAddress specifies the address to be confirmed.
  6388. (No meta-characters are allowed in the entity name.) NBPRetransmitInfo contains the
  6389. retry interval and the retry count. The socket number of the entity is returned in
  6390. nbpDataField. NBPConfirm is more efficient than NBPLookup in terms of network traffic.
  6391.  
  6392. Result codes    noErr           No error
  6393.                 nbpConfDiff     Name confirmed for different socket
  6394.                 nbpNoConfirm    Name not confirmed
  6395.  
  6396. æKY NBPRemove
  6397. æFc AppleTalk.h
  6398. æT Function
  6399. æD pascal OSErr NBPRemove(EntityPtr abEntity); 
  6400. æDT OSErr myVariable = NBPRemove((EntityPtr) abEntity);
  6401. æMM
  6402. æRI II-301
  6403. æC 
  6404. NBPRemove removes an entity name from the names table of the given entity’s node.
  6405.  
  6406. Result codes    noErr          No error
  6407.                 nbpNotFound    Name not found
  6408.  
  6409. æKY NBPLoad
  6410. æFc AppleTalk.h
  6411. æT Function
  6412. æD pascal OSErr NBPLoad(void); 
  6413. æDT OSErr myVariable = NBPLoad()(void);
  6414. æMM
  6415. æRI II-301
  6416. æC 
  6417. On a Macintosh 128K, NBPLoad reads the NBP code from the system resource file into
  6418. the application heap. On a Macintosh 512K or XL, NBPLoad has no effect since the NBP
  6419. code should have already been loaded when the .MPP driver was opened. Normally you’ll
  6420. never need to call NBPLoad, because the AppleTalk Manager calls it when necessary.
  6421.  
  6422. Result codes    noErr    No error
  6423.  
  6424. æKY NBPUnload
  6425. æFc AppleTalk.h
  6426. æT Function
  6427. æD pascal OSErr NBPUnload(void); 
  6428. æDT OSErr myVariable = NBPUnload()(void);
  6429. æMM
  6430. æRI II-301
  6431. æC 
  6432. On a Macintosh 128K, NBPUnload makes the NBP code purgeable; the space isn’t actually
  6433. released by the Memory Manager until necessary. On a Macintosh 512K or Macintosh XL,
  6434. NBPUnload has no effect.
  6435.  
  6436. Result codes    noErr    No error
  6437.  
  6438. »Example
  6439.  
  6440. This example of NBP registers our node as a print spooler, searches for any print
  6441. spoolers registered on the network, and then extracts the information for the first
  6442. one found.
  6443.  
  6444. CONST
  6445.   mySocket = 20;
  6446.  
  6447. VAR
  6448.   myABRecord: ABRecHandle;
  6449.   myEntity: EntityName;
  6450.   entityAddr: AddrBlock;
  6451.   nbpNamePtr: Ptr;
  6452.   myBuffer: PACKED ARRAY [0..999] OF CHAR;
  6453.   errCode: INTEGER;
  6454.   async: BOOLEAN;
  6455.  
  6456. BEGIN
  6457.   errCode := MPPOpen;
  6458.   IF errCode <> noErr THEN
  6459.     WRITELN('Error in opening AppleTalk')
  6460.     {Maybe serial port B isn't available for use by AppleTalk}
  6461.   ELSE
  6462.     BEGIN
  6463.       {Call Memory Manager to allocate ABusRecord}
  6464.       myABRecord := ABRecHandle(NewHandle(nbpSize));
  6465.       {Set up our entity name to register}
  6466.       WITH myEntity DO
  6467.         BEGIN
  6468.           objStr := 'Gene Station'; {we are called 'Gene Station' }
  6469.           typeStr := 'PrintSpooler'; { and are of type 'PrintSpooler'}
  6470.           zoneStr := '*';
  6471.           {Allocate data space for the entity name (used by NBP)}
  6472.           nbpNamePtr := NewPtr(LENGTH(objStr) + LENGTH(typeStr) +
  6473.                                LENGTH(zoneStr) + 12);
  6474.         END;
  6475.       {Set up the ABusRecord for the NBPRegister call}
  6476.       WITH myABRecord^^ DO
  6477.         BEGIN
  6478.           nbpEntityPtr := @myEntity;
  6479.           nbpBufPtr := nbpNamePtr; {buffer used by NBP internally}
  6480.           nbpBufSize := nbpNameBufSize;
  6481.           nbpAddress.aSocket := mySocket; {socket to register us on}
  6482.           nbpRetransmitInfo.retransInterval := 8; {retransmit every 64 }
  6483.           nbpRetransmitInfo.retransCount := 3; { ticks and try 3 times}
  6484.         END;
  6485.       async := FALSE;
  6486.       errCode := NBPRegister(myABRecord, async);
  6487.       IF errCode <> noErr THEN
  6488.         WRITELN('Error occurred in the NBPRegister call')
  6489.         {Maybe the name is already registered somewhere else on the }
  6490.         { network.}
  6491.       ELSE
  6492.         BEGIN
  6493.           {Now that we've registered our name, find others of type }
  6494.           { 'PrintSpooler'.}
  6495.           WITH myEntity DO
  6496.             BEGIN
  6497.               objStr := '='; {any one of type }
  6498.               typeStr := 'PrintSpooler'; { “PrintSpooler” }
  6499.               zoneStr := '*'; { in our zone}
  6500.             END;
  6501.           WITH myABRecord^^ DO
  6502.             BEGIN
  6503.               nbpEntityPtr := @myEntity;
  6504.               nbpBufPtr := @myBuffer; {buffer to place responses in}
  6505.               nbpBufSize := SIZEOF(myBuffer);
  6506.              {The field nbpDataField, before the NBPLookup call, represents an }
  6507.               { approximate number of responses. After the call, nbpDataField }
  6508.               { contains the actual number of responses received.}
  6509.               nbpDataField := 100; {we want about 100 responses back}
  6510.             END;
  6511.           errCode := NBPLookup(myABRecord, async); {make sync call}
  6512.           IF errCode <> noErr THEN
  6513.             WRITELN('An error occurred in the NBPLookup')
  6514.             {Did the buffer overflow?}
  6515.           ELSE
  6516.             BEGIN
  6517.               {Get the first reply}
  6518.               errCode := NBPExtract(@mybuffer, myABRecord^^.nbpDataField, 1,
  6519.                                     myEntity, entityAddr);
  6520.            {The socket address and name of the entity are returned here. If we }
  6521.              { want all of them, we'll have to loop for each one in the buffer.}
  6522.               IF errCode <> noErr THEN WRITELN('Error in NBPExtract');
  6523.               {Maybe the one we wanted wasn't in the buffer}
  6524.             END;
  6525.         END;
  6526.     END;
  6527. END.
  6528.  
  6529. æKY RemoveHdlBlocks
  6530. æFc AppleTalk.h
  6531. æT Function
  6532. æD pascal void RemoveHdlBlocks(void); 
  6533. æDT RemoveHdlBlocks()(void);
  6534. æC 
  6535.  
  6536. æKY GetNodeAddress
  6537. æFc AppleTalk.h
  6538. æT Function
  6539. æD pascal OSErr GetNodeAddress(short *myNode,short *myNet); 
  6540. æDT OSErr myVariable = GetNodeAddress((short *) myNode,(short *) myNet);
  6541. æRI II-303
  6542. æC 
  6543. GetNodeAddress returns the current node ID and network number of the caller. If the
  6544. .MPP driver isn’t installed, it returns noMPPErr. If myNet contains 0, this means
  6545. that a bridge hasn’t yet been found.
  6546.  
  6547. Result codes    noErr       No error
  6548.                 noMPPErr    MPP driver not installed
  6549.  
  6550. æKY IsMPPOpen
  6551. æFc AppleTalk.h
  6552. æT Function
  6553. æD pascal Boolean IsMPPOpen(void); 
  6554. æDT Boolean myVariable = IsMPPOpen()(void);
  6555. æRI II-304
  6556. æC 
  6557. [Not in ROM]
  6558.  
  6559. IsMPPOpen returns TRUE if the .MPP driver is loaded and running.
  6560.  
  6561. æKY IsATPOpen
  6562. æFc AppleTalk.h
  6563. æT Function
  6564. æD pascal Boolean IsATPOpen(void); 
  6565. æDT Boolean myVariable = IsATPOpen()(void);
  6566. æRI II-304
  6567. æC 
  6568. [Not in ROM]
  6569.  
  6570. IsATPOpen returns TRUE if the .ATP driver is loaded and running.
  6571.  
  6572.  
  6573. æKY Assert.h
  6574. æC 
  6575. assert
  6576.  
  6577. #include <Assert.h>
  6578. void assert (int expression);
  6579.  
  6580.                            Description
  6581.  
  6582. The assert; macro allows your program to send diagnostic 
  6583. messages to the user, depending on the evaluation of 
  6584. expression. If expression is false, assert provides an error 
  6585. message, and then calls the abort function. The format for this 
  6586. message is FILE myfile.c; Line 108 ##assertion failed: i<j
  6587.  
  6588. The assert macro can be activated using the NDEBUG macro. If 
  6589. NDEBUG is turned off, assert will evaluate expression.
  6590.  
  6591.                            Note
  6592.  
  6593. The message pointed to by assert is an executable MPW 
  6594. command. When the command is executed, it will open the 
  6595. source file containing the assert and highlight the assert statement.
  6596.  
  6597. Example
  6598. #include <assert.h>
  6599. main()
  6600. {
  6601.  int i,j;
  6602.  i = foo();
  6603.  j = 3;
  6604.  assert (i<100);         /* This depends on the compile-time */
  6605.                          /* setting of NDEBUG. If */
  6606.                          /* NDEBUG is defined,  the assert */
  6607.                          /* statement is not passed from the  */
  6608.                          /* preprocessor to the compiler */
  6609.  #undef NDEBUG           /* Turn off NDEBUG */
  6610.  #include <assert.h>
  6611.  assert (i<j);           /* This assert is turned on */
  6612.  #define NDEBUG          /* Turn on NDEBUG */
  6613.  #include <assert.h>
  6614.  j = foo();
  6615.  assert (j <100);        /* This assert is turned off */
  6616. }
  6617. See also
  6618. abort
  6619.  
  6620. æKY assert
  6621. æFc Assert.h
  6622. æC #include <Assert.h>
  6623. void assert (int expression);
  6624.  
  6625.                            Description
  6626.  
  6627. The assert; macro allows your program to send diagnostic 
  6628. messages to the user, depending on the evaluation of 
  6629. expression. If expression is false, assert provides an error 
  6630. message, and then calls the abort function. The format for this 
  6631. message is FILE myfile.c; Line 108 ##assertion failed: i<j
  6632.  
  6633. The assert macro can be activated using the NDEBUG macro. If 
  6634. NDEBUG is turned off, assert will evaluate expression.
  6635.  
  6636.                            Note
  6637.  
  6638. The message pointed to by assert is an executable MPW 
  6639. command. When the command is executed, it will open the 
  6640. source file containing the assert and highlight the assert statement.
  6641.  
  6642. Example
  6643. #include <assert.h>
  6644. main()
  6645. {
  6646.  int i,j;
  6647.  i = foo();
  6648.  j = 3;
  6649.  assert (i<100);         /* This depends on the compile-time */
  6650.                          /* setting of NDEBUG. If */
  6651.                          /* NDEBUG is defined,  the assert */
  6652.                          /* statement is not passed from the  */
  6653.                          /* preprocessor to the compiler */
  6654.  #undef NDEBUG           /* Turn off NDEBUG */
  6655.  #include <assert.h>
  6656.  assert (i<j);           /* This assert is turned on */
  6657.  #define NDEBUG          /* Turn on NDEBUG */
  6658.  #include <assert.h>
  6659.  j = foo();
  6660.  assert (j <100);        /* This assert is turned off */
  6661. }
  6662. See also
  6663. abort
  6664.  
  6665. æKY assertæ                     
  6666. æDT 
  6667. void myVariable = assert ((int) expression);
  6668.  
  6669. æKY Balloons.h
  6670. æKL HMBalloonRect
  6671. HMBaloonPict
  6672. HMExtractHelpMsg
  6673. HMFillCitationString
  6674. HMGetBalloons
  6675. HMGetDialogResID
  6676. HMGetFont
  6677. HMGetFontSize
  6678. HMGetMenuResID
  6679. HMIsBalloon
  6680. HMMouseInApplRgn
  6681. HMRemoveBalloon
  6682. HMScanTemplateItems
  6683. HMSetBalloons
  6684. HMSetDialogResID
  6685. HMSetFont
  6686. HMSetFontSize
  6687. HMSetMenuResID
  6688. HMShowBalloon
  6689. HMShowMenuBalloon
  6690.  
  6691. hdlgLocalCoords
  6692. hdlgSaveBits
  6693. hdlgUseSubID
  6694. helpItem
  6695. hmBadSelector
  6696. hmBalloonAborted
  6697. HMCompareItem
  6698. hmCouldNotLoadPackage
  6699. HMDefaultRecord
  6700. HMDefaultRecPtr
  6701. hmGestaltBalloonsOff
  6702. hmGestaltBalloonsOn
  6703. hmGestaltHelpType
  6704. hmHelpDisabled
  6705. HMLHHandleType
  6706. hmMemFullErr
  6707. HMMessageRecord
  6708. HMMessageRecordPtr
  6709. HMNamedResourceItem
  6710. HMPicHDefaultRecord
  6711. HMPicHDefaultRecPtr
  6712. HMPicHMsgRecord
  6713. HMPicHMsgRecPtr
  6714. HMPictDefaultRecord
  6715. HMPictDefaultRecPtr
  6716. HMPictItem
  6717. HMPictMsgRecord
  6718. HMPictMsgRecPtr
  6719. hmResNotFound
  6720. hmSameAsLastBalloon
  6721. HMSkipItem
  6722. hmSkippedBalloon
  6723. HMSTHandleType
  6724. HMStringDefaultRecord
  6725. HMStringDefaultRecPtr
  6726. HMStringItem
  6727. HMStringMsgRecord
  6728. HMStringMsgRecPtr
  6729. HMStringRecord
  6730. HMStringResItem
  6731. HMStringResType
  6732. HMStrResDefaultRecord
  6733. HMStrResDefaultRecPtr
  6734. HMSTRResItem
  6735. HMStrResMsgRecord
  6736. HMStrResMsgRecPtr
  6737. HMTEHDefaultRecord
  6738. HMTEHDefaultRecPtr
  6739. HMTEHMsgRecord
  6740. HMTEHMsgRecPtr
  6741. HMTEResItem
  6742. HMTEResType
  6743. HMTEStyleType
  6744. HMTrackCntlItem
  6745. hmUnknownHelpType
  6746. HMVersionWord
  6747. hmWrongVersion
  6748. hwinUseResID
  6749. hwinUseSubID
  6750. kBalloonWDEFID
  6751. kHMAboutHelpID
  6752. kHMChecked
  6753. kHMCheckedItem
  6754. kHMDisabled
  6755. kHMDisabledItem
  6756. kHMEasy1Access
  6757. kHMEasy2Access
  6758. kHMEasy3Access
  6759. kHMEnabled
  6760. kHMEnabledItem
  6761. kHMHelpIconOff
  6762. kHMHelpIconOn
  6763. kHMHelpID
  6764. kHMHelpMenuID
  6765. kHMhrctAbsolute
  6766. kHMInDisabledScrollBar
  6767. kHMInDragIndex
  6768. kHMInGoAwayIndex
  6769. kHMInGrowIndex
  6770. kHMInScrollBar
  6771. kHMInZoomIndex
  6772. kHMMenuTitleIndex
  6773. khmmPict
  6774. khmmPictHandle
  6775. khmmString
  6776. khmmStringRes
  6777. khmmSTRRes
  6778. khmmTEHandle
  6779. khmmTERes
  6780. kHMMultiFinderIndex
  6781. kHMOther
  6782. kHMOtherItem
  6783. kHMUsingHelpIndex
  6784. kHMUsingHelpItem
  6785. kHMWhatIsIndex
  6786. kHMWhatIsItem
  6787.  
  6788. æKY HMVersionWord
  6789. æFc Balloons.h
  6790. æT #define
  6791. æD #define HMVersionWord 0x0002
  6792. æC 
  6793.  
  6794. æKY hmHelpDisabled
  6795. æFc Balloons.h
  6796. æT #define
  6797. æD 
  6798. /* Help Mgr error range: -850 to -874 */
  6799.  
  6800. #define hmHelpDisabled -850
  6801. æC 
  6802.  
  6803. æKY hmResNotFound
  6804. æFc Balloons.h
  6805. æT #define
  6806. æD #define hmResNotFound -851
  6807. æC 
  6808.  
  6809. æKY hmMemFullErr
  6810. æFc Balloons.h
  6811. æT #define
  6812. æD #define hmMemFullErr -852
  6813. æC 
  6814.  
  6815. æKY hmBalloonAborted
  6816. æFc Balloons.h
  6817. æT #define
  6818. æD #define hmBalloonAborted -853
  6819. æC 
  6820.  
  6821. æKY hmSameAsLastBalloon
  6822. æFc Balloons.h
  6823. æT #define
  6824. æD #define hmSameAsLastBalloon -854
  6825. æC 
  6826.  
  6827. æKY hmBadSelector
  6828. æFc Balloons.h
  6829. æT #define
  6830. æD #define hmBadSelector -856
  6831. æC 
  6832.  
  6833. æKY hmSkippedBalloon
  6834. æFc Balloons.h
  6835. æT #define
  6836. æD #define hmSkippedBalloon -857
  6837. æC 
  6838.  
  6839. æKY hmWrongVersion
  6840. æFc Balloons.h
  6841. æT #define
  6842. æD #define hmWrongVersion -858
  6843. æC 
  6844.  
  6845. æKY hmUnknownHelpType
  6846. æFc Balloons.h
  6847. æT #define
  6848. æD #define hmUnknownHelpType -859
  6849. æC 
  6850.  
  6851. æKY hmCouldNotLoadPackage
  6852. æFc Balloons.h
  6853. æT #define
  6854. æD #define hmCouldNotLoadPackage -860
  6855. æC 
  6856.  
  6857. æKY hmGestaltHelpType
  6858. æFc Balloons.h
  6859. æT #define
  6860. æD 
  6861. /* Gestalt */
  6862.  
  6863. #define hmGestaltHelpType 'help'
  6864. æC 
  6865.  
  6866. æKY hmGestaltBalloonsOn
  6867. æFc Balloons.h
  6868. æT #define
  6869. æD #define hmGestaltBalloonsOn 0
  6870. æC 
  6871.  
  6872. æKY hmGestaltBalloonsOff
  6873. æFc Balloons.h
  6874. æT #define
  6875. æD #define hmGestaltBalloonsOff 1
  6876. æC 
  6877.  
  6878. æKY kHMUsingHelpItem
  6879. æFc Balloons.h
  6880. æT #define
  6881. æD #define kHMUsingHelpItem 1
  6882. æC 
  6883.  
  6884. æKY kHMWhatIsItem
  6885. æFc Balloons.h
  6886. æT #define
  6887. æD #define kHMWhatIsItem 3
  6888. æC 
  6889.  
  6890. æKY kHMHelpID
  6891. æFc Balloons.h
  6892. æT #define
  6893. æD #define kHMHelpID -5696
  6894. æC 
  6895.  
  6896. æKY kHMMultiFinderIndex
  6897. æFc Balloons.h
  6898. æT #define
  6899. æD 
  6900. /*  System STR# resource indexes  */
  6901.  
  6902. #define kHMMultiFinderIndex 1
  6903. æC 
  6904.  
  6905. æKY kHMMenuTitleIndex
  6906. æFc Balloons.h
  6907. æT #define
  6908. æD #define kHMMenuTitleIndex 2
  6909. æC 
  6910.  
  6911. æKY kHMUsingHelpIndex
  6912. æFc Balloons.h
  6913. æT #define
  6914. æD #define kHMUsingHelpIndex 3
  6915. æC 
  6916.  
  6917. æKY kHMWhatIsIndex
  6918. æFc Balloons.h
  6919. æT #define
  6920. æD #define kHMWhatIsIndex 4
  6921. æC 
  6922.  
  6923. æKY kHMInDragIndex
  6924. æFc Balloons.h
  6925. æT #define
  6926. æD #define kHMInDragIndex 5
  6927. æC 
  6928.  
  6929. æKY kHMInGrowIndex
  6930. æFc Balloons.h
  6931. æT #define
  6932. æD #define kHMInGrowIndex 6
  6933. æC 
  6934.  
  6935. æKY kHMInGoAwayIndex
  6936. æFc Balloons.h
  6937. æT #define
  6938. æD #define kHMInGoAwayIndex 7
  6939. æC 
  6940.  
  6941. æKY kHMInZoomIndex
  6942. æFc Balloons.h
  6943. æT #define
  6944. æD #define kHMInZoomIndex 8
  6945. æC 
  6946.  
  6947. æKY kHMInScrollBar
  6948. æFc Balloons.h
  6949. æT #define
  6950. æD #define kHMInScrollBar 9
  6951. æC 
  6952.  
  6953. æKY kHMInDisabledScrollBar
  6954. æFc Balloons.h
  6955. æT #define
  6956. æD #define kHMInDisabledScrollBar 10
  6957. æC 
  6958.  
  6959. æKY kHMEasy1Access
  6960. æFc Balloons.h
  6961. æT #define
  6962. æD #define kHMEasy1Access 11
  6963. æC 
  6964.  
  6965. æKY kHMEasy2Access
  6966. æFc Balloons.h
  6967. æT #define
  6968. æD #define kHMEasy2Access 12
  6969. æC 
  6970.  
  6971. æKY kHMEasy3Access
  6972. æFc Balloons.h
  6973. æT #define
  6974. æD #define kHMEasy3Access 13
  6975. æC 
  6976.  
  6977. æKY kHMAboutHelpID
  6978. æFc Balloons.h
  6979. æT #define
  6980. æD 
  6981. /* misc Constants */
  6982.  
  6983. #define kHMAboutHelpID -5696
  6984. æC 
  6985.  
  6986. æKY kHMHelpMenuID
  6987. æFc Balloons.h
  6988. æT #define
  6989. æD #define kHMHelpMenuID -5696
  6990. æC 
  6991.  
  6992. æKY kHMHelpIconOn
  6993. æFc Balloons.h
  6994. æT #define
  6995. æD #define kHMHelpIconOn -5696
  6996. æC 
  6997.  
  6998. æKY kHMHelpIconOff
  6999. æFc Balloons.h
  7000. æT #define
  7001. æD #define kHMHelpIconOff -5695
  7002. æC 
  7003.  
  7004. æKY kBalloonWDEFID
  7005. æFc Balloons.h
  7006. æT #define
  7007. æD 
  7008. /* WhatIs default WDEF res ID */
  7009.  
  7010. #define kBalloonWDEFID 126
  7011. æC 
  7012.  
  7013. æKY helpItem
  7014. æFc Balloons.h
  7015. æT #define
  7016. æD 
  7017. /* Dialog item template type */
  7018.  
  7019. #define helpItem 1
  7020. æC 
  7021.  
  7022. æKY kHMhrctAbsolute
  7023. æFc Balloons.h
  7024. æT #define
  7025. æD 
  7026. /* hrct Options */
  7027.  
  7028. #define kHMhrctAbsolute 0
  7029. æC 
  7030.  
  7031. æKY kHMEnabledItem
  7032. æFc Balloons.h
  7033. æT #define
  7034. æD 
  7035. /* Generic defines for the switch items used in 'hmnu' & 'hdlg' */
  7036.  
  7037. #define kHMEnabledItem 0
  7038. æC 
  7039.  
  7040. æKY kHMDisabledItem
  7041. æFc Balloons.h
  7042. æT #define
  7043. æD #define kHMDisabledItem 1
  7044. æC 
  7045.  
  7046. æKY kHMCheckedItem
  7047. æFc Balloons.h
  7048. æT #define
  7049. æD #define kHMCheckedItem 2
  7050. æC 
  7051.  
  7052. æKY kHMOtherItem
  7053. æFc Balloons.h
  7054. æT #define
  7055. æD #define kHMOtherItem 3
  7056. æC 
  7057.  
  7058. æKY hdlgUseSubID
  7059. æFc Balloons.h
  7060. æT #define
  7061. æD #define hdlgUseSubID 0 /* if set then use sub ID's to fine res ID*/
  7062. æC 
  7063.  
  7064. æKY hdlgLocalCoords
  7065. æFc Balloons.h
  7066. æT #define
  7067. æD #define hdlgLocalCoords 1 /* if set then use hdlg rects as local coords, ignoring item rects*/
  7068. æC 
  7069.  
  7070. æKY hdlgSaveBits
  7071. æFc Balloons.h
  7072. æT #define
  7073. æD #define hdlgSaveBits 2 /* if set then use save bits behind balloon*/
  7074. æC 
  7075.  
  7076. æKY hwinUseResID
  7077. æFc Balloons.h
  7078. æT #define
  7079. æD 
  7080. /* Option bits for hwin resources */
  7081.  
  7082. #define hwinUseResID 0
  7083. æC 
  7084.  
  7085. æKY hwinUseSubID
  7086. æFc Balloons.h
  7087. æT #define
  7088. æD #define hwinUseSubID 1
  7089. æC 
  7090.  
  7091. æKY HMStringItem
  7092. æFc Balloons.h
  7093. æT #define
  7094. æD 
  7095. /* Constants for Help Types in 'hmnu', 'hdlg', 'hrct' resources */
  7096.  
  7097. #define HMStringItem 1
  7098. æC 
  7099.  
  7100. æKY HMPictItem
  7101. æFc Balloons.h
  7102. æT #define
  7103. æD #define HMPictItem 2
  7104. æC 
  7105.  
  7106. æKY HMStringResItem
  7107. æFc Balloons.h
  7108. æT #define
  7109. æD #define HMStringResItem 3
  7110. æC 
  7111.  
  7112. æKY HMTEResItem
  7113. æFc Balloons.h
  7114. æT #define
  7115. æD #define HMTEResItem 6
  7116. æC 
  7117.  
  7118. æKY HMSTRResItem
  7119. æFc Balloons.h
  7120. æT #define
  7121. æD #define HMSTRResItem 7
  7122. æC 
  7123.  
  7124. æKY HMSkipItem
  7125. æFc Balloons.h
  7126. æT #define
  7127. æD #define HMSkipItem 256
  7128. æC 
  7129.  
  7130. æKY HMCompareItem
  7131. æFc Balloons.h
  7132. æT #define
  7133. æD #define HMCompareItem 512
  7134. æC 
  7135.  
  7136. æKY HMNamedResourceItem
  7137. æFc Balloons.h
  7138. æT #define
  7139. æD #define HMNamedResourceItem 1024
  7140. æC 
  7141.  
  7142. æKY HMTrackCntlItem
  7143. æFc Balloons.h
  7144. æT #define
  7145. æD #define HMTrackCntlItem 2048
  7146. æC 
  7147.  
  7148. æKY khmmString
  7149. æFc Balloons.h
  7150. æT #define
  7151. æD 
  7152. /* Constants for hmmHelpType's when filling out HMMessageRecord */
  7153.  
  7154. #define khmmString 1
  7155. æC 
  7156.  
  7157. æKY khmmPict
  7158. æFc Balloons.h
  7159. æT #define
  7160. æD #define khmmPict 2
  7161. æC 
  7162.  
  7163. æKY khmmStringRes
  7164. æFc Balloons.h
  7165. æT #define
  7166. æD #define khmmStringRes 3
  7167. æC 
  7168.  
  7169. æKY khmmTEHandle
  7170. æFc Balloons.h
  7171. æT #define
  7172. æD #define khmmTEHandle 4
  7173. æC 
  7174.  
  7175. æKY khmmPictHandle
  7176. æFc Balloons.h
  7177. æT #define
  7178. æD #define khmmPictHandle 5
  7179. æC 
  7180.  
  7181. æKY khmmTERes
  7182. æFc Balloons.h
  7183. æT #define
  7184. æD #define khmmTERes 6
  7185. æC 
  7186.  
  7187. æKY khmmSTRRes
  7188. æFc Balloons.h
  7189. æT #define
  7190. æD #define khmmSTRRes 7
  7191. æC 
  7192.  
  7193. æKY kHMEnabled
  7194. æFc Balloons.h
  7195. æT #define
  7196. æD #define kHMEnabled 1
  7197. æC 
  7198.  
  7199. æKY kHMDisabled
  7200. æFc Balloons.h
  7201. æT #define
  7202. æD #define kHMDisabled 2
  7203. æC 
  7204.  
  7205. æKY kHMChecked
  7206. æFc Balloons.h
  7207. æT #define
  7208. æD #define kHMChecked 4
  7209. æC 
  7210.  
  7211. æKY kHMOther
  7212. æFc Balloons.h
  7213. æT #define
  7214. æD #define kHMOther 8
  7215. æC 
  7216.  
  7217. æKY HMTEResType
  7218. æFc Balloons.h
  7219. æT #define
  7220. æD 
  7221. /* ResTypes for Styled TE Handles when extracting from Resources */
  7222.  
  7223. #define HMTEResType 'thdl'
  7224. æC 
  7225.  
  7226. æKY HMTEStyleType
  7227. æFc Balloons.h
  7228. æT #define
  7229. æD #define HMTEStyleType 'tsty'
  7230. æC 
  7231.  
  7232. æKY HMSTHandleType
  7233. æFc Balloons.h
  7234. æT #define
  7235. æD #define HMSTHandleType 'tstb'
  7236. æC 
  7237.  
  7238. æKY HMLHHandleType
  7239. æFc Balloons.h
  7240. æT #define
  7241. æD #define HMLHHandleType 'thtb'
  7242. æC 
  7243.  
  7244. æKY HMStringResType
  7245. æFc Balloons.h
  7246. æT struct
  7247. æD struct HMStringResType {
  7248.     short hmmResID;
  7249.     short hmmIndex;
  7250. };
  7251.  
  7252. typedef struct HMStringResType HMStringResType;
  7253. æC 
  7254.  
  7255. æKY HMStringMsgRecord
  7256. HMStringMsgRecPtr
  7257. æFc Balloons.h
  7258. æT struct
  7259. æD struct HMStringMsgRecord {
  7260.     short hmmHelpType;
  7261.     Str255 hmmString;
  7262. };
  7263.  
  7264. typedef struct HMStringMsgRecord HMStringMsgRecord;
  7265. typedef HMStringMsgRecord *HMStringMsgRecPtr;
  7266.  
  7267. æC 
  7268.  
  7269. æKY HMPictMsgRecord
  7270. HMPictMsgRecPtr
  7271. æFc Balloons.h
  7272. æT struct
  7273. æD struct HMPictMsgRecord {
  7274.     short hmmHelpType;
  7275.     short hmmPict;
  7276.     char fill[254];
  7277. };
  7278.  
  7279. typedef struct HMPictMsgRecord HMPictMsgRecord;
  7280. typedef HMPictMsgRecord *HMPictMsgRecPtr;
  7281.  
  7282. æC 
  7283.  
  7284. æKY HMTEHMsgRecord
  7285. HMTEHMsgRecPtr
  7286. æFc Balloons.h
  7287. æT struct
  7288. æD struct HMTEHMsgRecord {
  7289.     short hmmHelpType;
  7290.     Handle hmmTEHandle;
  7291.     char fill[252];
  7292. };
  7293.  
  7294. typedef struct HMTEHMsgRecord HMTEHMsgRecord;
  7295. typedef HMTEHMsgRecord *HMTEHMsgRecPtr;
  7296.  
  7297. æC 
  7298.  
  7299. æKY HMStrResMsgRecord
  7300. HMStrResMsgRecPtr
  7301. æFc Balloons.h
  7302. æT struct
  7303. æD struct HMStrResMsgRecord {
  7304.     short hmmHelpType;
  7305.     HMStrResType hmmStrRes;
  7306.     char fill[250];
  7307. };
  7308.  
  7309. typedef struct HMStrResMsgRecord HMStrResMsgRecord;
  7310. typedef HMStrResMsgRecord *HMStrResMsgRecPtr;
  7311.  
  7312. æC 
  7313.  
  7314. æKY HMPicHMsgRecord
  7315. HMPicHMsgRecPtr
  7316. æFc Balloons.h
  7317. æT struct
  7318. æD struct HMPicHMsgRecord {
  7319.     short hmmHelpType;
  7320.     PicHandle hmmPicHandle;
  7321.     char fill[252];
  7322. };
  7323.  
  7324. typedef struct HMPicHMsgRecord HMPicHMsgRecord;
  7325. typedef HMPicHMsgRecord *HMPicHMsgRecPtr;
  7326.  
  7327. æC 
  7328.  
  7329. æKY HMDefaultRecord
  7330. HMDefaultRecPtr
  7331. æFc Balloons.h
  7332. æT struct
  7333. æD struct HMDefaultRecord {
  7334.     short hmVersion;
  7335.     HMStringMsgRecord hmDefMessage;
  7336.     short hmHelpVRefNum;
  7337.     long hmHelpDirID;
  7338.     Boolean hmSearchAlternateFiles;
  7339. };
  7340.  
  7341. typedef struct HMDefaultRecord HMDefaultRecord;
  7342. typedef HMDefaultRecord *HMDefaultRecPtr;
  7343.  
  7344. æC 
  7345.  
  7346. æKY HMStringDefaultRecord
  7347. HMStringDefaultRecPtr
  7348. æFc Balloons.h
  7349. æT struct
  7350. æD struct HMStringDefaultRecord {
  7351.     short hmVersion;
  7352.     HMStringMsgRecord hmDefMessage;
  7353.     short hmHelpVRefNum;
  7354.     long hmHelpDirID;
  7355.     Boolean hmSearchAlternateFiles;
  7356. };
  7357.  
  7358. typedef struct HMStringDefaultRecord HMStringDefaultRecord;
  7359. typedef HMStringDefaultRecord *HMStringDefaultRecPtr;
  7360.  
  7361. æC 
  7362.  
  7363. æKY HMPictDefaultRecord
  7364. HMPictDefaultRecPtr
  7365. æFc Balloons.h
  7366. æT struct
  7367. æD struct HMPictDefaultRecord {
  7368.     short hmVersion;
  7369.     HMPictMsgRecord hmDefMessage;
  7370.     short hmHelpVRefNum;
  7371.     long hmHelpDirID;
  7372.     Boolean hmSearchAlternateFiles;
  7373. };
  7374.  
  7375. typedef struct HMPictDefaultRecord HMPictDefaultRecord;
  7376. typedef HMPictDefaultRecord *HMPictDefaultRecPtr;
  7377.  
  7378. æC 
  7379.  
  7380. æKY HMTEHDefaultRecord
  7381. HMTEHDefaultRecPtr
  7382. æFc Balloons.h
  7383. æT struct
  7384. æD struct HMTEHDefaultRecord {
  7385.     short hmVersion;
  7386.     HMTEHMsgRecord hmDefMessage;
  7387.     short hmHelpVRefNum;
  7388.     long hmHelpDirID;
  7389.     Boolean hmSearchAlternateFiles;
  7390. };
  7391.  
  7392. typedef struct HMTEHDefaultRecord HMTEHDefaultRecord;
  7393. typedef HMTEHDefaultRecord *HMTEHDefaultRecPtr;
  7394.  
  7395. æC 
  7396.  
  7397. æKY HMStrResDefaultRecord
  7398. HMStrResDefaultRecPtr
  7399. æFc Balloons.h
  7400. æT struct
  7401. æD struct HMStrResDefaultRecord {
  7402.     short hmVersion;
  7403.     HMStrResMsgRecord hmDefMessage;
  7404.     short hmHelpVRefNum;
  7405.     long hmHelpDirID;
  7406.     Boolean hmSearchAlternateFiles;
  7407. };
  7408.  
  7409. typedef struct HMStrResDefaultRecord HMStrResDefaultRecord;
  7410. typedef HMStrResDefaultRecord *HMStrResDefaultRecPtr;
  7411.  
  7412. æC 
  7413.  
  7414. æKY HMPicHDefaultRecord
  7415. HMPicHDefaultRecPtr
  7416. æFc Balloons.h
  7417. æT struct
  7418. æD struct HMPicHDefaultRecord {
  7419.     short hmVersion;
  7420.     HMPicHMsgRecord hmDefMessage;
  7421.     short hmHelpVRefNum;
  7422.     long hmHelpDirID;
  7423.     Boolean hmSearchAlternateFiles;
  7424. };
  7425.  
  7426. typedef struct HMPicHDefaultRecord HMPicHDefaultRecord;
  7427. typedef HMPicHDefaultRecord *HMPicHDefaultRecPtr;
  7428.  
  7429. æC 
  7430.  
  7431. æKY HMStringRecord
  7432. æFc Balloons.h
  7433. æT struct
  7434. æD struct HMStringRecord {
  7435.     short hmmHelpType;
  7436.     short hmmFont;
  7437.     short hmmFontSize;
  7438.     char hmmMessage[256];
  7439. };
  7440.  
  7441. typedef struct HMStringRecord HMStringRecord;
  7442. æC 
  7443.  
  7444. æKY HMMessageRecord
  7445. HMMessageRecordPtr
  7446. æFc Balloons.h
  7447. æT struct
  7448. æD union HMMessageRecord {
  7449.     HMStringMsgRecord HMStringMsg;
  7450.     HMPictMsgRecord HMPictMsg;
  7451.     HMTEHMsgRecord HMTEHMsg;
  7452.     HMStrResMsgRecord HMStrResMsg;
  7453.     HMResSTRMsgRecord HMResSTRMsg;
  7454.     HMPicHMsgRecord HMPicHMsg;
  7455. };
  7456.  
  7457. typedef union HMMessageRecord HMMessageRecord;
  7458.  
  7459. typedef HMMessageRecord *HMMessageRecordPtr;
  7460.  
  7461. æC 
  7462.  
  7463. æKY HMShowBalloon
  7464. æFc Balloons.h
  7465. æT Function
  7466. æD pascal short HMShowBalloon(const HMMessageRecord *aHelpMsg,Point tip,Rect *alternateRect,
  7467.     Ptr tipProc,short theProc,short variant,Boolean saveBits)
  7468.     = {0x303C,0x0B01,_Pack14}; 
  7469. æDT short myVariable = HMShowBalloon((const HMMessageRecord *) aHelpMsg,(Point) tip,(Rect *) alternateRect,()
  7470.     Ptr tipProc,(short) theProc,(short) variant,(Boolean) saveBits);
  7471. æC 
  7472. If help is enabled, you can use the HMShowBalloon function to display a balloon
  7473. containing the message specified by the message parameter; the balloon’s tip is
  7474. located at the point specified by the tip parameter.
  7475.  
  7476. Use the HMShowBalloon function to display a help message for an item that the
  7477. user can move. Use the HMShowMenuBalloon function to display help messages for
  7478. your application’s non-standard menus.
  7479.  
  7480. Parameter  Description
  7481. message    specifies the help message to be displayed. The HMMessageRecord
  7482.            data type is described in “The Help Message Record” earlier
  7483.            in this chapter.
  7484.  
  7485. tip        specifies, in global coordinates, the point where you want to 
  7486.            position the balloon’s tip.  For additional information about how 
  7487.            the Help Manager positions balloons, see “How the Help Manager 
  7488.            Positions the Help Balloon” earlier in this chapter.
  7489.  
  7490. hotRect    defines the area for which a specific help message is owned. That
  7491.            is, if the user moves the cursor anywhere outside the area specified
  7492.            by the hotRect parameter (once a balloon has been displayed), the
  7493.            Help Manager will remove the balloon This area is also the area of
  7494.            drift for the balloon tip. That is, if your specification for the
  7495.            tip parameter would force the Help Manager to position a balloon so
  7496.            that it obscures the element to be explained or so that it spills 
  7497.            off the screen, the Help Manager attempts to relocate the tip within
  7498.            the area defined by the hotRect parameter. See “How the Help Manager
  7499.            Positions the Help Balloon” earlier in this chapter for additional
  7500.            information.
  7501.  
  7502. tipProc    specifies the address of a procedure you write that tests the 
  7503.            values of the tip position and the balloon rectangle calculated by 
  7504.            the Help Manager. You would write such a procedure if you anticipated
  7505.            problems positioning a help balloon. Using this function gives the 
  7506.            application one more chance to modify the balloon’s position or
  7507.            dimensions before displaying it.  Pass NIL for the tipProc parameter
  7508.            if you want the Help Manager to ignore the HMBaloonHook function. For
  7509.            additional information, see “Testing the Tip Position and the 
  7510.            Dimensions of the Help Balloon” earlier in this chapter for 
  7511.            additional information.
  7512.  
  7513. theProc    specifies the resource ID of the window definition procedure
  7514.            that you want the Help Manager to use to define the help balloon 
  7515.            shape. The Help Manager reads the ‘WDEF’ resource into memory if it’s
  7516.            not already in memory.  If the Help Manager cannot find or read the
  7517.            resource, the balloon is not displayed and the function returns the
  7518.            system error -192, resNotFound. To use the Help Manager’s default
  7519.            balloon shape, pass 0 for both the procedure and the variant 
  7520.            parameter.
  7521.  
  7522. variant    specifies the variation code for the window definition
  7523.            procedure specified by the parameter theProc. If you specify 0 
  7524.            for the parameter theProc, you can still specify a value for 
  7525.            variant to indicate a preferred tip position for the default
  7526.            balloon. See "Defining Your Own Balloon Shape" earlier in 
  7527.            this chapter for additional information.
  7528.  
  7529. saveBits   a value of TRUE specifies that the Help Manager should save the
  7530.            bits behind the balloon.  Only use the saveBits option if you are
  7531.            certain that the bits behind the balloon will still be valid when
  7532.            the balloon is removed; as would be the case, for example, with 
  7533.            the bits behind a pulled down menu.  
  7534.            
  7535.            A value of FALSE specifies that the Window Manager should generate
  7536.            an update event for the window behind the balloon when you remove the
  7537.  
  7538.            balloon.
  7539.  
  7540.            You must specify FALSE for saveBits if the parameter theProc is
  7541.            non-zero,that is, if you are defining your own balloon shape.
  7542.  
  7543. The HMShowBalloon function returns the noErr result if the Help Manager displays
  7544. a balloon. If help was disabled or if no balloon was displayed, the function
  7545. returns a non-zero result.
  7546.  
  7547. Result codes
  7548. noErr                      0  No error
  7549. paramErr                 –50  Bad parameters passed in message record
  7550. memFullErr              –108  Not enough room in heap zone
  7551. resNotFound             –192  The balloon ‘WDEF’ could not be read
  7552. hmHelpDisabled          –850  Help is disabled
  7553. hmBalloonAborted        –853  Cursor was not stationary
  7554. hmCouldnotLoadPackage   –860  There was not enough memory to load
  7555.                               package
  7556. hmOperationUnsupported  –861  Could not interpret call
  7557.  
  7558. æKY HMRemoveBalloon
  7559. æFc Balloons.h
  7560. æT Function
  7561. æD pascal short HMRemoveBalloon(void)
  7562.     = {0x303C,0x0002,_Pack14}; 
  7563. æDT short myVariable = HMRemoveBalloon()(void);
  7564. æC 
  7565. The HMRemoveBalloon function removes any help message that is currently visible.
  7566. If no help message is visible, the HMRemoveBalloon function does nothing.  Use
  7567. the HMRemoveBalloon function to remove balloons created either by HMShowBalloon
  7568. or HMShowMenuBalloon. 
  7569.  
  7570. If a balloon is visible and the user disables help, the Help Manager calls this
  7571. function automatically.  The Help Manager also calls the HMRemoveBalloon
  7572. function so that no more than one help balloon is displayed at any time. Thus if
  7573. your application makes successive calls to show balloons without calling the
  7574. HMRemoveBalloon function, the Help Manager calls the HMRemoveBalloon function
  7575. automatically to remove the first balloon before displaying the second balloon.
  7576.  
  7577. If your application has called the HMShowBalloon function to display a help
  7578. message and the hotRect parameter was NIL, call the HMRemoveBalloon function
  7579. when the cursor moves out of the specified area. In a customized 'MDEF'
  7580. definition procedure, call the HMRemoveBalloon function before hiding a drawn
  7581. menu. In a customized 'MBDF' procedure, call the HMRemoveBalloon function in
  7582. response to the messages SaveBits and RestoreBits before saving or restoring any
  7583. bits.
  7584.  
  7585. Results codes
  7586. noErr                      0  No error; a balloon was removed
  7587. paramErr                 –50  Bad parameters passed in message record
  7588. hmHelpDisabled          –850  Balloon help is disabled
  7589. hmCouldnotLoadPackage   –860  There was not enough memory to load
  7590.                               package
  7591. hmOperationUnsupported  –861  Could not interpret call
  7592.  
  7593. æKY HMGetBalloons
  7594. æFc Balloons.h
  7595. æT Function
  7596. æD pascal Boolean HMGetBalloons(void)
  7597.     = {0x303C,0x0003,_Pack14}; 
  7598. æDT Boolean myVariable = HMGetBalloons()(void);
  7599. æC 
  7600. The HMGetBalloons function returns the current setting of the flag parameter for
  7601. the HMSetBalloons function.
  7602.  
  7603. æKY HMSetBalloons
  7604. æFc Balloons.h
  7605. æT Function
  7606. æD pascal Short HMSetBalloons(Boolean flag)
  7607.     = {0x303C,0x0104,_Pack14}; 
  7608. æDT Short myVariable = HMSetBalloons((Boolean) flag);
  7609. æC 
  7610. Calling the HMSetBalloons function activates the Help Manager if the value of
  7611. the flag parameter is TRUE and turns it off if the value of flag is FALSE.  When
  7612. help is enabled, the Help Manager automatically displays balloons for standard
  7613. window parts and system dialog boxes. Disabling help removes any balloon
  7614. displayed by calls to the HMShowBalloon or HMShowMenuBalloon functions. 
  7615.  
  7616. Result codes
  7617. noErr                     0  No error
  7618. hmCouldnotLoadPackage  –860  There was not enough memory to load
  7619.                               package
  7620. hmOperationUnsupported  –861  Could not interpret call
  7621.  
  7622. æKY HMShowMenuBalloon
  7623. æFc Balloons.h
  7624. æT Function
  7625. æD pascal short HMShowMenuBalloon(short itemNum,short itemMenuID,long itemFlags,
  7626.     long itemReserved,Point tip,Ptr alternateRect,Ptr tipProc,short theProc,
  7627.     short variant)
  7628.     = {0x303C,0x0E05,_Pack14}; 
  7629. æDT short myVariable = HMShowMenuBalloon((short) itemNum,(short) itemMenuID,(long) itemFlags,()
  7630.     long itemReserved,(Point) tip,(Ptr) alternateRect,(Ptr) tipProc,(short) theProc,()
  7631.     short variant);
  7632. æC 
  7633. The HMShowMenuBalloon function allows you to display help balloons for an
  7634. application's non-standard menu. You call the HMShowMenuBalloon function from 
  7635. a menu’s ‘MDEF’ definition procedure right after drawing, highlighting, or
  7636. determining that the cursor is over a menu item.
  7637.  
  7638. Parameter   Description
  7639. itemNum     specifies the number of the menu item to which the cursor is 
  7640.             pointing. If the cursor points to the menu title, the itemNum 
  7641.             parameter contains 0;if the cursor points to a dashed line, the 
  7642.             itemNum parameter contains -1.
  7643.  
  7644. itemMenuID  specifies the menuID of the menu currently in use.
  7645.  
  7646. itemFlags   specifies the menu's enabledFlags Longword, which tells the Help
  7647.             Manager whether the menu item is enabled or disabled. The Help 
  7648.             Manager uses this value to select the corresponding message
  7649.             from the ‘hmnu’ resource associated with the menu specified by 
  7650.             itemMenuID.
  7651.  
  7652. itemReserved  reserved for future expansion; specify 0
  7653.  
  7654. tip         specifies, in global coordinates, the point where you want the
  7655.             balloon’s tip.  For additional information about how the Help 
  7656.             Manager positions balloons, see “How the Help Manager Positions 
  7657.             the Help Balloon” earlier in this chapter.
  7658.  
  7659. hotRect     specifies the area of drift for the balloon tip. That is, if
  7660.             your specification for the tip parameter would force the Help
  7661.             Manager to position a balloon so that it obscures the element to 
  7662.             be explained or so that it spills off the screen, the Help Manager
  7663.             attempts to relocate the tip within the area defined by the
  7664.             hotRect.parameter. See “How the Help Manager Positions the Help 
  7665.             Balloon” earlier in this chapter for additional information.
  7666.  
  7667. tipProc     specifies the address of a procedure you write that tests the
  7668.             values of the tip position and the balloon rectangle calculated by
  7669.             the Help Manager. You would write such a procedure if you 
  7670.             anticipated problems positioning a help balloon.  Using this
  7671.             function gives the application one more chance to modify the 
  7672.             balloon’s position or the dimensions of the balloon before 
  7673.             displaying it. Pass NIL for the tipProc parameter if you want the 
  7674.             Help Manager to ignore the HMBaloonHook function. For additional
  7675.             information, see “Changing the Tip Position and the Dimensions of
  7676.             the Help Balloon” earlier in this chapter for additional
  7677.             information.
  7678.  
  7679. reserved    specify 0.
  7680.  
  7681. reserved    specify 0.
  7682.  
  7683. Result codes
  7684. noErr                      0  No error
  7685. paramErr                 –50  Bad parameters passed in message record
  7686. memFullErr              –108  Not enough room in heap zone
  7687. resNotFound             –192  'hmnu' resource could not be read
  7688. hmHelpDisabled          –850  Balloon help is disabled
  7689. hmCouldnotLoadPackage   –860  There was not enough memory to load
  7690.        package
  7691. hmOperationUnsupported  –861  Could not interpret call
  7692.  
  7693. æKY HMMouseInApplRgn
  7694. æFc Balloons.h
  7695. æT Function
  7696. æD pascal Boolean HMMouseInApplRgn(void)
  7697.     = {0x303C,0x0006,_Pack14}; 
  7698. æDT Boolean myVariable = HMMouseInApplRgn()(void);
  7699. æC 
  7700.  
  7701. æKY HMIsBalloon
  7702. æFc Balloons.h
  7703. æT Function
  7704. æD pascal Boolean HMIsBalloon(void)
  7705.     = {0x303C,0x0007,_Pack14}; 
  7706. æDT Boolean myVariable = HMIsBalloon()(void);
  7707. æC 
  7708. The HMIsBalloon function determines whether a help balloon is currently showing.
  7709. A return value of TRUE means that a balloon is showing; a value of FALSE means
  7710. that no balloon is showing.
  7711.  
  7712. æKY HMSetFont
  7713. æFc Balloons.h
  7714. æT Function
  7715. æD pascal Short HMSetFont(short font)
  7716.     = {0x303C,0x0108,_Pack14}; 
  7717. æDT Short myVariable = HMSetFont((short) font);
  7718. æC 
  7719.  
  7720. æKY HMSetFontSize
  7721. æFc Balloons.h
  7722. æT Function
  7723. æD pascal Short HMSetFontSize(short fontsize)
  7724.     = {0x303C,0x0109,_Pack14}; 
  7725. æDT Short myVariable = HMSetFontSize((short) fontsize);
  7726. æC 
  7727.  
  7728. æKY HMGetFont
  7729. æFc Balloons.h
  7730. æT Function
  7731. æD pascal Short HMGetFont(short *font)
  7732.     = {0x303C,0x020A,_Pack14}; 
  7733. æDT Short myVariable = HMGetFont((short *) font);
  7734. æC 
  7735.  
  7736. æKY HMGetFontSize
  7737. æFc Balloons.h
  7738. æT Function
  7739. æD pascal Short HMGetFontSize(short *fontSize)
  7740.     = {0x303C,0x020B,_Pack14}; 
  7741. æDT Short myVariable = HMGetFontSize((short *) fontSize);
  7742. æC 
  7743.  
  7744. æKY HMSetDialogResID
  7745. æFc Balloons.h
  7746. æT Function
  7747. æD pascal Short HMSetDialogResID(short resID)
  7748.     = {0x303C,0x010C,_Pack14}; 
  7749. æDT Short myVariable = HMSetDialogResID((short) resID);
  7750. æC 
  7751. You can use the HMSetDialogResID function in two ways:
  7752.  
  7753. 1.  If a dialog or alert item list  ('DITL') does not include a helpItem
  7754.     specifying an 'hdlg' ID that the Help Manager should use to display
  7755.     help messages, calling the HMSetDialogResID function just before 
  7756.     displaying the dialog or alert box tells the Help Manager to display help
  7757.     messages stored in the 'hdlg' resource whose ID is specified by resID.
  7758.  
  7759. 2.  If a dialog or alert item list does include a helpItem, you call the
  7760.     HMSetDialogResID function just before displaying the dialog or alert box
  7761.     to override the 'hdlg' ID resource specified in the helpItem field. 
  7762.     Call the HMSetDialogResID function with a resID value of -1 after displaying
  7763.     the alert or dialog box to clear (reset) the first call.
  7764.  
  7765. Result codes
  7766. noErr                      0  No error
  7767. memFullErr              –108  Not enough room in the heap zone
  7768. resNotFound             –192  'hdlg' resource could not be read  
  7769. hmCouldnotLoadPackage   –860  There was not enough memory to load pacage
  7770. hmOperationUnsupported  –861  Could not interpret call
  7771.  
  7772. æKY HMSetMenuResID
  7773. æFc Balloons.h
  7774. æT Function
  7775. æD pascal Short HMSetMenuResID(short menuID,short resID)
  7776.     = {0x303C,0x020D,_Pack14}; 
  7777. æDT Short myVariable = HMSetMenuResID((short) menuID,(short) resID);
  7778. æC 
  7779. The HMSetMenuResID function overrides the ‘hmnu’ resource ID used to provide
  7780. help text for a particular menu.
  7781.  
  7782. The menuID parameter specifies an existing menu ID in the application’s menu
  7783. list.  The resID parameter specifies a ‘hmnu’ resource ID that is to be used in
  7784. place of the ‘hmnu’ resource normally used to provide help for the specified
  7785. menu.
  7786.  
  7787. If the menuID is not in the menu list, the function does nothing.
  7788.  
  7789. To dissociate the menu specified by menuID from the resource specified by resID,
  7790. specify -1 for the resID parameter.
  7791.  
  7792. Result codes
  7793. noErr                      0  No error
  7794. memFullErr              –108  Not enough room in the heap zone
  7795. resNotFound             –192  'hdlg' resource could not be read  
  7796. hmCouldnotLoadPackage   –860  There was not enough memory to load package
  7797. hmOperationUnsupported  –861  Could not interpret call
  7798.  
  7799. æKY HMBalloonRect
  7800. æFc Balloons.h
  7801. æT Function
  7802. æD pascal Short HMBalloonRect(const HMMessageRecord *aHelpMsg,Rect *coolRect)
  7803.     = {0x303C,0x040E,_Pack14}; 
  7804. æDT Short myVariable = HMBalloonRect((const HMMessageRecord *) aHelpMsg,(Rect *) coolRect);
  7805. æC 
  7806. The HMBalloonRect function returns a rectangle in the coolRect parameter that is
  7807. just the right size to display the text message specified by the aHelpMessage
  7808. parameter.
  7809.  
  7810. See “Providing Help for Application-Specific Elements” earlier in this chapter
  7811. for a description of the HMMessageRecord data type.
  7812.  
  7813. Result codes
  7814. noErr                           0  No Error
  7815. paramErr                      –50  Bad parameters passed in message
  7816.  memFullErr                  –108  Not enough room in heap zone
  7817. recordhmCouldnotLoadPackage  –860  There was not enough memory to load package 
  7818.  
  7819. hmOperationUnsupported       –861  Could not interpret call
  7820.  
  7821. æKY HMBaloonPict
  7822. æFc Balloons.h
  7823. æT Function
  7824. æD pascal Short HMBaloonPict(const HMMessageRecord *aHelpMsg,Handle *coolPict)
  7825.     = {0x303C,0x040F,_Pack14}; 
  7826. æDT Short myVariable = HMBaloonPict((const HMMessageRecord *) aHelpMsg,(Handle *) coolPict);
  7827. æC 
  7828. The HMBalloonPict function returns a handle to a picture that shows how the text
  7829. contained in aHelpMessage is going to be displayed.
  7830.  
  7831. Result codes
  7832. noErr                      0  No Error
  7833. paramErr                 –50  Bad parameters passed in message
  7834.  memFullErr             –108  Not enough room in heap zone
  7835. hmCouldnotLoadPackage   –860  There was not enough memory to load package
  7836. hmOperationUnsupported  –861  Could not interpret call
  7837.  
  7838. æKY HMScanTemplateItems
  7839. æFc Balloons.h
  7840. æT Function
  7841. æD pascal Short HMScanTemplateItems(Short whichID,Short whichResFile,ResType whichType)
  7842.     = {0x303C,0x0410,_Pack14}; 
  7843. æDT Short myVariable = HMScanTemplateItems((Short) whichID,(Short) whichResFile,(ResType) whichType);
  7844. æC 
  7845. You use this function when you have no other way of associating a dialog box or
  7846. window with an 'hdlg' or 'hrct' resource. This might happen because you have a
  7847. dialog box with a changing title and a fixed item list or because you want to
  7848. supply help for areas of a window whose title changes.
  7849.  
  7850. When you call this function the Help Manager will provide help messages (for the
  7851. frontmost window) from the resource whose type you specify with the whichType
  7852. parameter and whose ID you specify using the which ID parameter. The resource
  7853. must reside in the file specified by the whichResFile parameter and this file
  7854. must be open.
  7855.  
  7856. The whichType parameter specifies the type of the resource and must be either
  7857. 'hdlg' or 'hrct'.
  7858.  
  7859. Result codes
  7860. noErr                      0  No error
  7861. fnOpenErr                –38  Resource file was not open
  7862. paramErr                 –50  Bad parameters passed in message record
  7863. memFullErr              –108  Not enough room in heap zone
  7864. resnotFound             –192  'hmnu' resource could not be read
  7865. hmHelpDisabled          –850  Balloon help is disabled
  7866. hmCouldnotLoadPackage   –860  There was not enough memory to load
  7867.        package
  7868. hmOperationUnsupported  –861  Could not interpret call
  7869.  
  7870. æKY HMExtractHelpMsg
  7871. æFc Balloons.h
  7872. æT Function
  7873. æD pascal Short HMExtractHelpMsg(ResType whichType,Short whichResID,Short whichMsg,
  7874.     Short whichState,HMMessageRecord *aHelpMsg)
  7875.     = {0x303C,0x0711,_Pack14}; 
  7876. æDT Short myVariable = HMExtractHelpMsg((ResType) whichType,(Short) whichResID,(Short) whichMsg,()
  7877.     Short whichState,(HMMessageRecord *) aHelpMsg);
  7878. æC 
  7879.  
  7880. æKY HMFillCitationString
  7881. æFc Balloons.h
  7882. æT Function
  7883. æD pascal Short HMFillCitationString(StringPtr origString,StringPtr stuffString,
  7884.     Short key)
  7885.     = {0x303C,0x0512,_Pack14}; 
  7886. æDT Short myVariable = HMFillCitationString((StringPtr) origString,(StringPtr) stuffString,()
  7887.     Short key);
  7888. æC 
  7889.  
  7890. æKY HMGetDialogResID
  7891. æFc Balloons.h
  7892. æT Function
  7893. æD pascal Short HMGetDialogResID(short *resID)
  7894.     = {0x303C,0x0213,_Pack14}; 
  7895. æDT Short myVariable = HMGetDialogResID((short *) resID);
  7896. æC 
  7897. The HMGetDialogResID function returns the 'hdlg' resource ID that the Help
  7898. Manager is currently using to provide help messages for a dialog box. If there
  7899. is no current resource, resID contains -1.
  7900.  
  7901. Result codes
  7902. noErr                      0  No error
  7903. memFullErr              –108  Not enough room in the heap zone
  7904. resNotFound             –192  'hdlg' resource could not be read  
  7905. hmCouldnotLoadPackage   –860  There was not enough memory to load package
  7906. hmOperationUnsupported  –861  Could not interpret call
  7907.  
  7908. æKY HMGetMenuResID
  7909. æFc Balloons.h
  7910. æT Function
  7911. æD pascal Short HMGetMenuResID(short menuID,short *resID)
  7912.     = {0x303C,0x0314,_Pack14}; 
  7913. æDT Short myVariable = HMGetMenuResID((short) menuID,(short *) resID);
  7914. æC 
  7915. The HMGetMenuResID function returns the ID of the 'hmnu' resource that the Help
  7916. Manager is currently associating with the menu whose ID you specify for the
  7917. menuID parameter.
  7918.   
  7919. Result codes
  7920. noErr                      0  No error
  7921. memFullErr              –108  Not enough room in the heap zone
  7922. resNotFound             –192  'hdlg' resource could not be read  
  7923. hmCouldnotLoadPackage   –860  There was not enough memory to load package
  7924. hmOperationUnsupported  –861  Could not interpret call
  7925.  
  7926.  
  7927. æKY Controls.h
  7928. æKL DisposeControl
  7929. dragcontrol
  7930. DragControl
  7931. Draw1Control
  7932. DrawControls
  7933. findcontrol
  7934. FindControl
  7935. GetAuxCtl
  7936. GetCRefCon
  7937. GetCTitle
  7938. getctitle
  7939. GetCtlAction
  7940. GetCtlMax
  7941. GetCtlMin
  7942. GetCtlValue
  7943. GetCVariant
  7944. GetNewControl
  7945. HideControl
  7946. HiliteControl
  7947. KillControls
  7948. MoveControl
  7949. newcontrol
  7950. NewControl
  7951. SetCRefCon
  7952. SetCTitle
  7953. setctitle
  7954. SetCtlAction
  7955. SetCtlColor
  7956. SetCtlMax
  7957. SetCtlMin
  7958. SetCtlValue
  7959. ShowControl
  7960. SizeControl
  7961. testcontrol
  7962. TestControl
  7963. TrackControl
  7964. trackcontrol
  7965. UpdtControl
  7966.  
  7967. autoTrack
  7968. AuxCtlHandle
  7969. AuxCtlPtr
  7970. AuxCtlRec
  7971. calcCntlRgn
  7972. calcCRgns
  7973. calcThumbRgn
  7974. cBodyColor
  7975. CCTabHandle
  7976. CCTabPtr
  7977. cFrameColor
  7978. checkBoxProc
  7979. ControlHandle
  7980. ControlPtr
  7981. ControlRecord
  7982. cTextColor
  7983. cThumbColor
  7984. CtlCTab
  7985. dispCntl
  7986. dragCntl
  7987. drawCntl
  7988. hAxisOnly
  7989. inButton
  7990. inCheckBox
  7991. inDownButton
  7992. initCntl
  7993. inLabel
  7994. inMenu
  7995. inPageDown
  7996. inPageUp
  7997. inThumb
  7998. inTriangle
  7999. inUpButton
  8000. noConstraint
  8001. popupMenuProc
  8002. popupTitleCenterJust
  8003. popupTitleLeftJust
  8004. popupTitleRightJust
  8005. posCntl
  8006. pushButProc
  8007. radioButProc
  8008. scrollBarProc
  8009. testCntl
  8010. thumbCntl
  8011. useWFont
  8012. vAxisOnly
  8013.  
  8014. æKY pushButProc
  8015. æFc Controls.h
  8016. æT #define
  8017. æD #define pushButProc 0
  8018. æC 
  8019.  
  8020. æKY checkBoxProc
  8021. æFc Controls.h
  8022. æT #define
  8023. æD #define checkBoxProc 1
  8024. æC 
  8025.  
  8026. æKY radioButProc
  8027. æFc Controls.h
  8028. æT #define
  8029. æD #define radioButProc 2
  8030. æC 
  8031.  
  8032. æKY useWFont
  8033. æFc Controls.h
  8034. æT #define
  8035. æD #define useWFont 8
  8036. æC 
  8037.  
  8038. æKY scrollBarProc
  8039. æFc Controls.h
  8040. æT #define
  8041. æD #define scrollBarProc 16
  8042. æC 
  8043.  
  8044. æKY inButton
  8045. æFc Controls.h
  8046. æT #define
  8047. æD #define inButton 10
  8048. æC 
  8049.  
  8050. æKY inCheckBox
  8051. æFc Controls.h
  8052. æT #define
  8053. æD #define inCheckBox 11
  8054. æC 
  8055.  
  8056. æKY inUpButton
  8057. æFc Controls.h
  8058. æT #define
  8059. æD #define inUpButton 20
  8060. æC 
  8061.  
  8062. æKY inDownButton
  8063. æFc Controls.h
  8064. æT #define
  8065. æD #define inDownButton 21
  8066. æC 
  8067.  
  8068. æKY inPageUp
  8069. æFc Controls.h
  8070. æT #define
  8071. æD #define inPageUp 22
  8072. æC 
  8073.  
  8074. æKY inPageDown
  8075. æFc Controls.h
  8076. æT #define
  8077. æD #define inPageDown 23
  8078. æC 
  8079.  
  8080. æKY inThumb
  8081. æFc Controls.h
  8082. æT #define
  8083. æD #define inThumb 129
  8084. æC 
  8085.  
  8086. æKY popupMenuProc
  8087. æFc Controls.h
  8088. æT #define
  8089. æD #define popupMenuProc 1008 /* 63 * 16 */
  8090. æC 
  8091.  
  8092. æKY inLabel
  8093. æFc Controls.h
  8094. æT #define
  8095. æD #define inLabel 1
  8096. æC 
  8097.  
  8098. æKY inMenu
  8099. æFc Controls.h
  8100. æT #define
  8101. æD #define inMenu 2
  8102. æC 
  8103.  
  8104. æKY inTriangle
  8105. æFc Controls.h
  8106. æT #define
  8107. æD #define inTriangle 4
  8108. æC 
  8109.  
  8110. æKY popupTitleLeftJust
  8111. æFc Controls.h
  8112. æT #define
  8113. æD #define popupTitleLeftJust 0x0000
  8114. æC 
  8115.  
  8116. æKY popupTitleCenterJust
  8117. æFc Controls.h
  8118. æT #define
  8119. æD #define popupTitleCenterJust 0x0001
  8120. æC 
  8121.  
  8122. æKY popupTitleRightJust
  8123. æFc Controls.h
  8124. æT #define
  8125. æD #define popupTitleRightJust 0x00FF
  8126. æC 
  8127.  
  8128. æKY noConstraint
  8129. æFc Controls.h
  8130. æT #define
  8131. æD 
  8132. /* 
  8133. axis constraints for DragGrayRgn call */
  8134.  
  8135. #define noConstraint 0
  8136. æC 
  8137.  
  8138. æKY hAxisOnly
  8139. æFc Controls.h
  8140. æT #define
  8141. æD #define hAxisOnly 1
  8142. æC 
  8143.  
  8144. æKY vAxisOnly
  8145. æFc Controls.h
  8146. æT #define
  8147. æD #define vAxisOnly 2
  8148. æC 
  8149.  
  8150. æKY drawCntl
  8151. æFc Controls.h
  8152. æT #define
  8153. æD 
  8154. /* 
  8155. control messages */
  8156.  
  8157. #define drawCntl 0
  8158. æC 
  8159.  
  8160. æKY testCntl
  8161. æFc Controls.h
  8162. æT #define
  8163. æD #define testCntl 1
  8164. æC 
  8165.  
  8166. æKY calcCRgns
  8167. æFc Controls.h
  8168. æT #define
  8169. æD #define calcCRgns 2
  8170. æC 
  8171.  
  8172. æKY initCntl
  8173. æFc Controls.h
  8174. æT #define
  8175. æD #define initCntl 3
  8176. æC 
  8177.  
  8178. æKY dispCntl
  8179. æFc Controls.h
  8180. æT #define
  8181. æD #define dispCntl 4
  8182. æC 
  8183.  
  8184. æKY posCntl
  8185. æFc Controls.h
  8186. æT #define
  8187. æD #define posCntl 5
  8188. æC 
  8189.  
  8190. æKY thumbCntl
  8191. æFc Controls.h
  8192. æT #define
  8193. æD #define thumbCntl 6
  8194. æC 
  8195.  
  8196. æKY dragCntl
  8197. æFc Controls.h
  8198. æT #define
  8199. æD #define dragCntl 7
  8200. æC 
  8201.  
  8202. æKY autoTrack
  8203. æFc Controls.h
  8204. æT #define
  8205. æD #define autoTrack 8
  8206. æC 
  8207.  
  8208. æKY cFrameColor
  8209. æFc Controls.h
  8210. æT #define
  8211. æD #define cFrameColor 0
  8212. æC 
  8213.  
  8214. æKY cBodyColor
  8215. æFc Controls.h
  8216. æT #define
  8217. æD #define cBodyColor 1
  8218. æC 
  8219.  
  8220. æKY cTextColor
  8221. æFc Controls.h
  8222. æT #define
  8223. æD #define cTextColor 2
  8224. æC 
  8225.  
  8226. æKY cThumbColor
  8227. æFc Controls.h
  8228. æT #define
  8229. æD #define cThumbColor 3
  8230. æC 
  8231.  
  8232. æKY calcCntlRgn
  8233. æFc Controls.h
  8234. æT #define
  8235. æD #define calcCntlRgn 10
  8236. æC 
  8237.  
  8238. æKY calcThumbRgn
  8239. æFc Controls.h
  8240. æT #define
  8241. æD #define calcThumbRgn 11
  8242. æC 
  8243.  
  8244. æKY ControlRecord
  8245. ControlPtr
  8246. ControlHandle
  8247. æFc Controls.h
  8248. æT struct
  8249. æD struct ControlRecord {
  8250.     struct ControlRecord **nextControl;
  8251.     WindowPtr contrlOwner;
  8252.     Rect contrlRect;
  8253.     unsigned char contrlVis;
  8254.     unsigned char contrlHilite;
  8255.     short contrlValue;
  8256.     short contrlMin;
  8257.     short contrlMax;
  8258.     Handle contrlDefProc;
  8259.     Handle contrlData;
  8260.     ProcPtr contrlAction;
  8261.     long contrlRfCon;
  8262.     Str255 contrlTitle;
  8263. };
  8264.  
  8265. typedef struct ControlRecord ControlRecord;
  8266. typedef ControlRecord *ControlPtr, **ControlHandle;
  8267.  
  8268. æC 
  8269. Every control is represented internally by a control record containing all pertinent
  8270. information about that control. The control record contains the following:
  8271.  
  8272.   •  A pointer to the window the control belongs to.
  8273.   •  A handle to the next control in the window’s control list.
  8274.   •  A handle to the control definition function.
  8275.   •  The control’s title, if any.
  8276.   •  A rectangle that completely encloses the control, which determines
  8277.      the control’s size and location within its window. The entire control,
  8278.      including the title of a check box or radio button, is drawn inside
  8279.      this rectangle.
  8280.   •  An indication of whether the control is currently active and how it’s
  8281.      to be highlighted.
  8282.   •  The current setting of the control (if this type of control retains a
  8283.      setting) and the minimum and maximum values the setting can assume. For
  8284.      check boxes and radio buttons, a setting of 0 means the control is off
  8285.      and 1 means it’s on.
  8286.  
  8287. The control record also contains an indication of whether the control is currently
  8288. visible or invisible. These terms refer only to whether the control is drawn in its
  8289. window, not to whether you can see it on the screen. A control may be “visible” and
  8290. still not appear on the screen, because it’s obscured by overlapping windows or other
  8291. objects.
  8292.  
  8293. There’s a field in the control record for a pointer to the control’s default action
  8294. procedure. An action procedure defines some action to be performed repeatedly for as
  8295. long as the user holds down the mouse button inside the control. The default action
  8296. procedure may be used by the Control Manager function TrackControl if you call it
  8297. without passing a pointer to an action procedure; this is discussed in detail in the
  8298. description of TrackControl in the “Control Manager Routines” section.
  8299.  
  8300. Finally, the control record includes a 32-bit reference value field, which is reserved
  8301. for use by your application. You specify an initial reference value when you create a
  8302. control, and can then read or change the reference value whenever you wish.
  8303.  
  8304. The data type for a control record is called ControlRecord. A control record is
  8305. referred to by a handle:
  8306.  
  8307. TYPE  ControlPtr     = ^ControlRecord;
  8308.       ControlHandle  = ^ControlPtr;
  8309.  
  8310. The Control Manager functions for creating a control return a handle to a newly
  8311. allocated control record; thereafter, your program should normally refer to the
  8312. control by this handle. Most of the Control Manager routines expect a control handle
  8313. as their first parameter.
  8314.  
  8315. You can store into and access most of a control record’s fields with Control Manager
  8316. routines, so normally you don’t have to know the exact field names. However, if you
  8317. want more information about the exact structure of a control record—if you’re defining
  8318. your own control types, for instance—it’s given below.
  8319.  
  8320. _______________________________________________________________________________
  8321.  
  8322. »The ControlRecord Data Type
  8323.  
  8324. The ControlRecord data type is defined as follows:
  8325.  
  8326. TYPE ControlRecord =
  8327.       PACKED RECORD
  8328.         nextControl:    ControlHandle;  {next control}
  8329.         contrlOwner:    WindowPtr;      {control's window}
  8330.         contrlRect:     Rect;           {enclosing rectangle}
  8331.         contrlVis:      Byte;           {255 if visible}
  8332.         contrlHilite:   Byte;           {highlight state}
  8333.         contrlValue:    INTEGER;        {control's current setting}
  8334.         contrlMin:      INTEGER;        {control's minimum setting}
  8335.         contrlMax:      INTEGER;        {control's maximum setting}
  8336.         contrlDefProc:  Handle;         {control definition function}
  8337.         contrlData:     Handle;         {data used by contrlDefProc}
  8338.         contrlAction:   ProcPtr;        {default action procedure}
  8339.         contrlRfCon:    LONGINT;        {control's reference value}
  8340.         contrlTitle:    Str255          {control's title}
  8341.       END;
  8342.  
  8343. NextControl is a handle to the next control associated with this control’s window.
  8344. All the controls belonging to a given window are kept in a linked list, beginning in
  8345. the controlList field of the window record and chained together through the nextControl
  8346. fields of the individual control records. The end of the list is marked by a NIL
  8347. value; as new controls are created, they’re added to the beginning of the list.
  8348.  
  8349. ContrlOwner is a pointer to the window that this control belongs to.
  8350.  
  8351. ContrlRect is the rectangle that completely encloses the control, in the local coordinates
  8352. of the control’s window.
  8353.  
  8354. When contrlVis is 0, the control is currently invisible; when it’s 255, the control
  8355. is visible.
  8356.  
  8357. ContrlHilite specifies whether and how the control is to be highlighted, indicating
  8358. whether it’s active or inactive. The HiliteControl procedure lets you set this field;
  8359. see the description of HiliteControl for more information about the meaning of the
  8360. field’s value.
  8361.  
  8362. ContrlValue is the control’s current setting. For check boxes and radio buttons, 0
  8363. means the control is off and 1 means it’s on. For dials, the fields contrlMin and
  8364. contrlMax define the range of possible settings; contrlValue may take on any value
  8365. within that range. Other (custom) control types can use these three fields as they
  8366. see fit.
  8367.  
  8368. ContrlDefProc is a handle to the control definition function for this type of control.
  8369. When you create a control, you identify its type with a control definition ID, which
  8370. is converted into a handle to the control definition function and stored in the
  8371. contrlDefProc field. Thereafter, the Control Manager uses this handle to access the
  8372. definition function; you should never need to refer to this field directly.
  8373.  
  8374. Note:  When not running in 32-bit mode, the high-order byte of the
  8375.        contrlDefProc field contains some additional information that
  8376.        the Control Manager gets from the control definition ID; for
  8377.        details, see the section “Defining Your Own Controls”.
  8378.  
  8379. ContrlData is reserved for use by the control definition function, typically to hold
  8380. additional information specific to a particular control type. For example, the standard
  8381. definition function for scroll bars uses this field for a handle to the region containing
  8382. the scroll bar’s thumb. If no more than four bytes of additional information are
  8383. needed, the definition function can store the information directly in the contrlData
  8384. field rather than use a handle.
  8385.  
  8386. ContrlAction is a pointer to the control’s default action procedure, if any. The
  8387. Control Manager function TrackControl may call this procedure to respond to the
  8388. user’s dragging the mouse inside the control.
  8389.  
  8390. ContrlRfCon is the control’s reference value field, which the application may store
  8391. into and access for any purpose.
  8392.  
  8393. ContrlTitle is the control’s title, if any.
  8394.  
  8395. æKY CtlCTab
  8396. CCTabPtr
  8397. CCTabHandle
  8398. æFc Controls.h
  8399. æT struct
  8400. æD struct CtlCTab {
  8401.     long ccSeed; /*reserved*/
  8402.     short ccRider; /*see what you have done - reserved*/
  8403.     short ctSize; /*usually 3 for controls*/
  8404.     ColorSpec ctTable[4];
  8405. };
  8406.  
  8407. typedef struct CtlCTab CtlCTab;
  8408. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  8409.  
  8410. æC 
  8411. The contents and meaning of a control’s color table are determined by its control
  8412. definition function (see “The Control Color Table Resource” section). The CTabHandle
  8413. parameter used in the Color Control Manager routines provides a handle to the control
  8414. color table. The components of a control color table are defined as follows:
  8415.  
  8416. TYPE
  8417.   CCTabHandle = ^CCTabPtr;
  8418.   CCTabPtr    = ^CtlCTab;
  8419.   CtlCTab     = RECORD
  8420.                   ccSeed:      LONGINT;    {not used for controls}
  8421.                   ccRider:     INTEGER;    {not used for controls}
  8422.                   ctSize:      INTEGER;    {number of entries in table –1}
  8423.                   ctTable:     cSpecArray  {array of ColorSpec records}
  8424.                 END;
  8425.  
  8426. Field descriptions
  8427.  
  8428. ccSeed        The ccSeed field is unused in control color tables.
  8429.  
  8430. ccRider       The ccRider field is unused in control color tables.
  8431.  
  8432. ctSize        The ctSize field defines the number of elements in the table,
  8433.               minus one. For controls drawn with the standard definition
  8434.               procedure, this field is always 3.
  8435.  
  8436. ctTable       The ctTable field holds an array of colorSpec records. Each
  8437.               colorSpec is made up of a partIdentifier field and a partRGB
  8438.               field. The partIdentifier field holds an integer which
  8439.               associates an RGBColor to a particular part of the control.
  8440.               The definition procedures attempt to find the appropriate part
  8441.               identifier when preparing to draw a part. If that part
  8442.               identifier is not found, the first color in the table is
  8443.               used to draw the part. The part identifiers can appear in any
  8444.               order in the table. The partRGB field specifies a standard RGB
  8445.               color record, indicating what absolute color will be used to
  8446.               draw the control part found in the partIdentifier field.
  8447.  
  8448. A standard control color table is shown in Figure 6.
  8449.  
  8450. •••Refer to Figure 6.•••
  8451.  
  8452. Figure 6–Control Color Table
  8453.  
  8454. The 'cctb' resource is an exact image of this control table data structure, and is
  8455. stored in the same format as 'clut' color table resources.
  8456.  
  8457. Standard buttons, check boxes, and radio buttons use a four-element color table with
  8458. part identifiers as shown below:
  8459.  
  8460.   cFrameColor (0)       Frame color
  8461.   cBodyColor (1)        Fill color for body of control
  8462.   cTextColor (2)        Text color
  8463.   cThumbColor (3)       Unused
  8464.  
  8465. When highlighted, plain buttons exchange their body and text colors (colors 1 and 2);
  8466. check boxes and radio buttons change their appearance without changing colors.  All
  8467. three types indicate deactivation by dimming their text with no change in colors.
  8468.  
  8469. Standard scroll bars use a four-element color table with part identifiers as shown
  8470. below:
  8471.  
  8472.   cFrameColor (0)       Frame color, foreground color for shaft and arrows
  8473.   cBodyColor (1         Background color for shaft and arrows
  8474.   cTextColor (2)        Unused
  8475.   cThumbColor (3)       Fill color for thumb
  8476.  
  8477. When highlighted, the arrows are filled with the foreground color (color 0) within
  8478. the arrow outline. A deactivated scroll bar shows no indicator, and displays its
  8479. shaft in solid background color (color 1), with no pattern.
  8480.  
  8481. The 'cctb' resource = 0 is read into the application heap when the application starts,
  8482. and serves as the default control color table. The last record in the auxiliary
  8483. control list points to the default 'cctb' resource. When drawing a control, the
  8484. standard control definition function searches the list for an auxiliary control
  8485. record whose acOwner points to the control being drawn.  If it finds such a record,
  8486. it uses the color table designated by that record; if it doesn’t find one before
  8487. reaching the default record at the end of the list, it uses the default color table
  8488. instead. All types of controls share the same default record. The default auxiliary
  8489. control record is recognized by NIL values in both its acNext and acOwner fields; the
  8490. application must not change these fields.
  8491.  
  8492. A nonstandard control definition function can use color tables of any desired size
  8493. and define their contents in any way it wishes, except that part indices 1 to 127 are
  8494. reserved for system definition.  Any such nonstandard function should take care to
  8495. bypass the defaulting mechanism just described, by allocating an explicit auxiliary
  8496. record for every control it creates.
  8497.  
  8498. æKY AuxCtlRec
  8499. AuxCtlPtr
  8500. AuxCtlHandle
  8501. æFc Controls.h
  8502. æT struct
  8503. æD struct AuxCtlRec {
  8504.     Handle acNext; /*handle to next AuxCtlRec*/
  8505.     ControlHandle acOwner; /*handle for aux record's control*/
  8506.     CCTabHandle acCTable; /*color table for this control*/
  8507.     short acFlags; /*misc flag byte*/
  8508.     long acReserved; /*reserved for use by Apple*/
  8509.     long acRefCon; /*for use by application*/
  8510. };
  8511.  
  8512. typedef struct AuxCtlRec AuxCtlRec;
  8513. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  8514.  
  8515. æC 
  8516. The information needed for drawing controls in color is kept in a linked list of
  8517. auxiliary control records, beginning in the global variable AuxCtlHead.
  8518. (Notice that there is just one global list for all controls in all windows, not a
  8519. separate one for each window.) Each window record has a handle to the list of controls.
  8520. Figure 5 shows the auxiliary control list structure.
  8521.  
  8522. •••Refer to Figure 5.•••
  8523.  
  8524. Figure 5–Auxiliary Control List
  8525.  
  8526. Each auxiliary control record is a relocatable object residing in the application
  8527. heap. The most important information it holds is a handle to the control’s individual
  8528. color table (see the “Control Color Tables” section).  The rest of the record consists
  8529. of a link to the next record in the list, a field that identifies the control’s
  8530. owner, a 4-byte field reserved for future expansion, and a 4-byte reference constant
  8531. for use by the application:
  8532.  
  8533. TYPE
  8534.   AuxCtlHandle = ^AuxCtlPtr;
  8535.   AuxCtlPtr    = ^AuxCtlRec;
  8536.   AuxCtlRec    = RECORD
  8537.                    acNext:      AuxCtlHandle;   {handle to next record in list}
  8538.                    acOwner:     ControlHandle;  {handle to owning control}
  8539.                    acCTable:    CCTabHandle;    {handle to control's color }
  8540.                                                 { table}
  8541.                    acFlags:     INTEGER;        {miscellaneous flags; reserved}
  8542.                    acReserved:  LONGINT;        {reserved for future expansion}
  8543.                    acRefCon:    LONGINT         {reserved for application use}
  8544.                  END;
  8545.  
  8546. Field descriptions
  8547.  
  8548. acNext        The acNext field contains a handle to the next record in
  8549.               the auxiliary control list.
  8550.  
  8551. acOwner       The acOwner field contains the handle of the control to
  8552.               which this auxiliary record belongs. Used as an ID field.
  8553.  
  8554. acCTable      The acCTable contains the handle to the control’s color
  8555.               table (see “Control Color Tables” below).
  8556.  
  8557. acFlags       The acFlags field contains miscellaneous flags for use by
  8558.               the Control Manager; this field is reserved.
  8559.  
  8560. acReserved    The acReserved field is reserved for future expansion;
  8561.               this must be set to 0 for future compatibility.
  8562.  
  8563. acRefCon      The acRefCon field is a reference constant for use by
  8564.               the application.
  8565.  
  8566. Not every control needs an auxiliary control record.  When an application is started,
  8567. a resource containing a default color table is loaded from the system resource file;
  8568. this resource defines a standard set of control colors. Since there is no InitControls
  8569. routine, this happens when an application calls InitWindows.
  8570.  
  8571. Separate auxiliary control records are needed only for controls whose color usage
  8572. differs from the default.  Each such nonstandard control must have its own auxiliary
  8573. record, even if it uses the same colors as another control. This allows two or more
  8574. auxiliary records to share the same control color table. If the control color table
  8575. is a resource, it won’t be deleted by DisposeControl. When using an auxiliary record
  8576. that is not stored as a resource, the application should not deallocate the color
  8577. table if another control is still using it.
  8578.  
  8579. A control created from scratch will initially have no auxiliary control record.  If
  8580. it is to use nonstandard colors, it must be given an auxiliary record and a color
  8581. table with SetCtlColor (see the “Control Manager Routines” section).  Such a control
  8582. should normally be made invisible at creation and then displayed with ShowControl
  8583. after the colors are set.  For controls created from a 'CNTL' resource,  the color
  8584. table can be specified as a resource as well. See the section titled “The Control
  8585. Color Table Resource”.
  8586.  
  8587. A/UX systems:  When using 32-bit mode. every control has its own auxiliary
  8588.                record. If there is no specific set of control colors for
  8589.                this control, the acCTable will point to the default color table.
  8590.  
  8591. æKY NewControl
  8592. æFc Controls.h
  8593. æT Function
  8594. æTN A954
  8595. æD pascal ControlHandle NewControl(WindowPtr theWindow,const Rect *boundsRect,
  8596.     const Str255 title,Boolean visible,short value,short min,short max,short procID,
  8597.     long refCon)
  8598.     = 0xA954; 
  8599. æDT ControlHandle myVariable = NewControl((WindowPtr) theWindow,(const Rect *) boundsRect,(
  8600.     const) Str255 title,(Boolean) visible,(short) value,(short) min,(short) max,(short) procID,()
  8601.     long refCon);
  8602. æMM
  8603. æRI I-319, P-112, 114, 177
  8604. æC  
  8605. NewControl creates a control, adds it to the beginning of theWindow’s control list,
  8606. and returns a handle to the new control. The values passed as parameters are stored
  8607. in the corresponding fields of the control record, as described below. The field that
  8608. determines highlighting is set to 0 (no highlighting) and the pointer to the default
  8609. action procedure is set to NIL (none).
  8610.  
  8611. Note:  The control definition function may do additional initialization,
  8612.        including changing any of the fields of the control record. The only
  8613.        standard control for which additional initialization is done is the
  8614.        scroll bar; its control definition function allocates space for a
  8615.        region to hold the thumb and stores the region handle in the
  8616.        contrlData field of the control record.
  8617.  
  8618. TheWindow is the window the new control will belong to. All coordinates pertaining to
  8619. the control will be interpreted in this window’s local coordinate system.
  8620.  
  8621. BoundsRect, given in theWindow’s local coordinates, is the rectangle that encloses
  8622. the control and thus determines its size and location. Note the following about the
  8623. enclosing rectangle for the standard controls:
  8624.  
  8625.   •  Simple buttons are drawn to fit the rectangle exactly. (The control
  8626.      definition function calls the QuickDraw procedure FrameRoundRect.) To
  8627.      allow for the tallest characters in the system font, there should be
  8628.      at least a 20-point difference between the top and bottom coordinates
  8629.      of the rectangle.
  8630.   •  For check boxes and radio buttons, there should be at least a 16-point
  8631.      difference between the top and bottom coordinates.
  8632.   •  By convention, scroll bars are 16 pixels wide, so there should be a
  8633.      16-point difference between the left and right (or top and bottom)
  8634.      coordinates. (If there isn’t, the scroll bar will be scaled to fit
  8635.      the rectangle.) A standard scroll bar should be at least 48 pixels
  8636.      long, to allow room for the scroll arrows and thumb.
  8637.  
  8638. Title is the control’s title, if any (if none, you can just pass the empty string as
  8639. the title). Be sure the title will fit in the control’s enclosing rectangle; if it
  8640. won’t it will be truncated on the right for check boxes and radio buttons, or centered
  8641. and truncated on both ends for simple buttons.
  8642.  
  8643. Note:  Some non-Roman systems write text from right-to-left, in which
  8644.        case radio buttons and check boxes are drawn with their titles
  8645.        on the left of the control.  They are also truncated on the left.
  8646.        See the Script Manager chapter for more information.
  8647.  
  8648. If the visible parameter is TRUE, NewControl draws the control.
  8649.  
  8650. Note:  It does not use the standard window updating mechanism, but
  8651.        instead draws the control immediately in the window.
  8652.  
  8653. The min and max parameters define the control’s range of possible settings; the value
  8654. parameter gives the initial setting. For controls that don’t retain a setting, such
  8655. as buttons, the values you supply for these parameters will be stored in the control
  8656. record but will never be used. So it doesn’t matter what values you give for those
  8657. controls—0 for all three parameters will do. For controls that just retain an on-or-off
  8658. setting, such as check boxes or radio buttons, min should be 0 (meaning the control
  8659. is off) and max should be 1
  8660. (meaning it’s on). For dials, you can specify whatever values are appropriate for
  8661. min, max, and value.
  8662.  
  8663. ProcID is the control definition ID, which leads to the control definition function
  8664. for this type of control. (The function is read into memory if it
  8665. isn’t already in memory.) The control definition IDs for the standard control types
  8666. are listed above under “Controls and Resources”. Control definition IDs for custom
  8667. control types are discussed later under “Defining Your Own Controls”.
  8668.  
  8669. RefCon is the control’s reference value, set and used only by your application.
  8670.  
  8671. æKY SetCTitle
  8672. æFc Controls.h
  8673. æT Function
  8674. æTN A95F
  8675. æD pascal void SetCTitle(ControlHandle theControl,const Str255 title)
  8676.     = 0xA95F; 
  8677. æDT SetCTitle((ControlHandle) theControl,(const Str255) title);
  8678. æMM
  8679. æRI I-321
  8680. æC  
  8681. SetCTitle sets theControl’s title to the given string and redraws the control.
  8682.  
  8683. æKY GetCTitle
  8684. æFc Controls.h
  8685. æT Function
  8686. æTN A95E
  8687. æD pascal void GetCTitle(ControlHandle theControl,Str255 title)
  8688.     = 0xA95E; 
  8689. æDT GetCTitle((ControlHandle) theControl,(Str255) title);
  8690. æRI I-321
  8691. æC 
  8692. GetCTitle returns theControl’s title as the value of the title parameter.
  8693.  
  8694. æKY GetNewControl
  8695. æFc Controls.h
  8696. æT Function
  8697. æTN A9BE
  8698. æD pascal ControlHandle GetNewControl(short controlID,WindowPtr owner)
  8699.     = 0xA9BE; 
  8700. æDT ControlHandle myVariable = GetNewControl((short) controlID,(WindowPtr) owner);
  8701. æMM
  8702. æRT 203
  8703. æRI I-321, P-112, 113, 114, 172
  8704. æC 
  8705. GetNewControl creates a control from a control template stored in a resource file,
  8706. adds it to the beginning of theWindow’s control list, and returns a handle to the new
  8707. control. ControlID is the resource ID of the template. GetNewControl works exactly
  8708. the same as NewControl (above), except that it gets the initial values for the new
  8709. control’s fields from the specified control template instead of accepting them as
  8710. parameters. If the control template can’t be read from the resource file, GetNewControl
  8711. returns NIL. It releases the memory occupied by the resource before returning.
  8712.  
  8713. The system default control colors are stored in the System file and ROMResources as
  8714. 'cctb' resource = 0. By including a 'cctb' resource = 0 in your application, it is
  8715. possible to change the default colors that will be used for all controls, unless a
  8716. specific 'cctb' exists for a control defined within the application.
  8717.  
  8718. When you use GetNewControl for the control resource 'CNTL', GetNewControl will attempt
  8719. to load a 'cctb' resource with the same ID as the 'CNTL' resource ID, if one is
  8720. present. It then executes the SetCtlColor call.
  8721.  
  8722. The following part identifiers for control elements should be present in the ColorSpec.value
  8723. field:
  8724.  
  8725.   cFrameColor (0)       Frame color
  8726.   cBodyColor (1)        Fill color for body of control
  8727.   cTextColor (2)        Text color
  8728.   cThumbColor (3)       Thumb color
  8729.  
  8730. These identifiers may be present in any order; for instance, the text or indicator
  8731. color values may be stored before the fill and frame colors in the ColorSpec record
  8732. structure. If a part identifier is not found, then the first color in the color table
  8733. will be used.
  8734.  
  8735. æKY DisposeControl
  8736. æFc Controls.h
  8737. æT Function
  8738. æTN A955
  8739. æD pascal void DisposeControl(ControlHandle theControl)
  8740.     = 0xA955; 
  8741. æDT DisposeControl((ControlHandle) theControl);
  8742. æMM
  8743. æRI I-321, P-168
  8744. æC 
  8745. Assembly-language note:  The macro you invoke to call DisposeControl from
  8746.                          assembly language is named _DisposControl.
  8747.  
  8748. DisposeControl removes theControl from the screen, deletes it from its window’s
  8749. control list, and releases the memory occupied by the control record and any data
  8750. structures associated with the control.
  8751.  
  8752. æKY KillControls
  8753. æFc Controls.h
  8754. æT Function
  8755. æTN A956
  8756. æD pascal void KillControls(WindowPtr theWindow)
  8757.     = 0xA956; 
  8758. æDT KillControls((WindowPtr) theWindow);
  8759. æMM
  8760. æRI I-321, P-113, 175
  8761. æC 
  8762. KillControls disposes of all controls associated with theWindow by calling DisposeControl
  8763. (above) for each.
  8764.  
  8765. Note:  Remember that the Window Manager procedures CloseWindow and
  8766.        DisposeWindow automatically dispose of all controls associated
  8767.        with the given window.
  8768.  
  8769. æKY HideControl
  8770. æFc Controls.h
  8771. æT Function
  8772. æTN A958
  8773. æD pascal void HideControl(ControlHandle theControl)
  8774.     = 0xA958; 
  8775. æDT HideControl((ControlHandle) theControl);
  8776. æMM
  8777. æRI I-322, P-113, 114, 174
  8778. æC 
  8779. HideControl makes theControl invisible. It fills the region the control occupies
  8780. within its window with the background pattern of the window’s grafPort. It also adds
  8781. the control’s enclosing rectangle to the window’s update region, so that anything
  8782. else that was previously obscured by the control will reappear on the screen. If the
  8783. control is already invisible, HideControl has no effect.
  8784.  
  8785. æKY ShowControl
  8786. æFc Controls.h
  8787. æT Function
  8788. æTN A957
  8789. æD pascal void ShowControl(ControlHandle theControl)
  8790.     = 0xA957; 
  8791. æDT ShowControl((ControlHandle) theControl);
  8792. æMM
  8793. æRT 197
  8794. æRI I-322, P-113, 114, 181
  8795. æC 
  8796. ShowControl makes theControl visible. The control is drawn in its window but may be
  8797. completely or partially obscured by overlapping windows or other objects. If the
  8798. control is already visible, ShowControl has no effect.
  8799.  
  8800. æKY DrawControls
  8801. æFc Controls.h
  8802. æT Function
  8803. æTN A969
  8804. æD pascal void DrawControls(WindowPtr theWindow)
  8805.     = 0xA969; 
  8806. æDT DrawControls((WindowPtr) theWindow);
  8807. æRT 203
  8808. æRI I-322, P-169
  8809. æC 
  8810. DrawControls draws all controls currently visible in theWindow. The controls are
  8811. drawn in reverse order of creation; thus in case of overlap the earliest-created
  8812. controls appear frontmost in the window.
  8813.  
  8814. Note:  Window Manager routines such as SelectWindow, ShowWindow, and
  8815.        BringToFront do not automatically call DrawControls to display
  8816.        the window’s controls. They just add the appropriate regions to
  8817.        the window’s update region, generating an update event. Your program
  8818.        should always call DrawControls explicitly upon receiving an update
  8819.        event for a window that contains controls.
  8820.  
  8821. æKY Draw1Control
  8822. æFc Controls.h
  8823. æT Function
  8824. æTN A96D
  8825. æD pascal void Draw1Control(ControlHandle theControl)
  8826.     = 0xA96D; 
  8827. æDT Draw1Control((ControlHandle) theControl);
  8828. æMM
  8829. æRI IV-53
  8830. æC 
  8831. [128K ROM]
  8832.  
  8833. Draw1Control draws the specified control if it’s visible within the window.
  8834.  
  8835. æKY HiliteControl
  8836. æFc Controls.h
  8837. æT Function
  8838. æTN A95D
  8839. æD pascal void HiliteControl(ControlHandle theControl,short hiliteState)
  8840.     = 0xA95D; 
  8841. æDT HiliteControl((ControlHandle) theControl,(short) hiliteState);
  8842. æMM
  8843. æRI I-322
  8844. æC 
  8845. HiliteControl changes the way theControl is highlighted. HiliteState has one of the
  8846. following values:
  8847.  
  8848.   •  The value 0 means no highlighting. (The control is active.)
  8849.   •  A value between 1 and 253 is interpreted as a part code designating
  8850.      the part of the (active) control to be highlighted.
  8851.   •  The value 255 means that the control is to be made inactive and
  8852.      highlighted accordingly.
  8853.  
  8854. Note:  The value 254 should not be used; this value is reserved for future use.
  8855.  
  8856. HiliteControl calls the control definition function to redraw the control with its
  8857. new highlighting.
  8858.  
  8859. æKY UpdtControl
  8860. æFc Controls.h
  8861. æT Function
  8862. æTN A953
  8863. æD pascal void UpdtControl(WindowPtr theWindow,RgnHandle updateRgn)
  8864.     = 0xA953; 
  8865. æDT UpdtControl((WindowPtr) theWindow,(RgnHandle) updateRgn);
  8866. æMM
  8867. æRI IV-53
  8868. æC  
  8869. [128K ROM]
  8870.  
  8871. UpdtControl is a faster version of the DrawControls procedure. Instead of drawing all
  8872. of the controls in theWindow, UpdtControl draws only the controls that are in the
  8873. specified update region. UpdtControl is called in response to an update event, and is
  8874. usually bracketed by calls to the Window Manager procedures BeginUpdate and EndUpdate.
  8875. UpdateRgn should be set to the visRgn of theWindow’s port (for more details, see the
  8876. BeginUpdate procedure in the Window Manager chapter).
  8877.  
  8878. Note:  In general, controls are in a dialog box and are automatically
  8879.        drawn by the DrawDialog procedure.
  8880.  
  8881. æKY MoveControl
  8882. æFc Controls.h
  8883. æT Function
  8884. æTN A959
  8885. æD pascal void MoveControl(ControlHandle theControl,short h,short v)
  8886.     = 0xA959; 
  8887. æDT MoveControl((ControlHandle) theControl,(short) h,(short) v);
  8888. æMM
  8889. æRI I-325, P-113, 176
  8890. æC 
  8891. MoveControl moves theControl to a new location within its window. The top left corner
  8892. of the control’s enclosing rectangle is moved to the horizontal and vertical coordinates
  8893. h and v (given in the local coordinates of the control’s window); the bottom right
  8894. corner is adjusted accordingly, to keep the size of the rectangle the same as before.
  8895. If the control is currently visible, it’s hidden and then redrawn at its new location.
  8896.  
  8897. æKY SizeControl
  8898. æFc Controls.h
  8899. æT Function
  8900. æTN A95C
  8901. æD pascal void SizeControl(ControlHandle theControl,short w,short h)
  8902.     = 0xA95C; 
  8903. æDT SizeControl((ControlHandle) theControl,(short) w,(short) h);
  8904. æMM
  8905. æRI I-326, P-113, 181
  8906. æC 
  8907. SizeControl changes the size of theControl’s enclosing rectangle. The bottom right
  8908. corner of the rectangle is adjusted to set the rectangle’s width and height to the
  8909. number of pixels specified by w and h; the position of the top left corner is not
  8910. changed. If the control is currently visible, it’s hidden and then redrawn in its new
  8911. size.
  8912.  
  8913. æKY SetCtlValue
  8914. æFc Controls.h
  8915. æT Function
  8916. æTN A963
  8917. æD pascal void SetCtlValue(ControlHandle theControl,short theValue)
  8918.     = 0xA963; 
  8919. æDT SetCtlValue((ControlHandle) theControl,(short) theValue);
  8920. æMM
  8921. æRT 197
  8922. æRI I-326
  8923. æC 
  8924. SetCtlValue sets theControl’s current setting to theValue and redraws the control to
  8925. reflect the new setting. For check boxes and radio buttons, the value 1 fills the
  8926. control with the appropriate mark, and 0 clears it. For scroll bars, SetCtlValue
  8927. redraws the thumb where appropriate.
  8928.  
  8929. If the specified value is out of range, it’s forced to the nearest endpoint of the
  8930. current range (that is, if theValue is less than the minimum setting, SetCtlValue
  8931. sets the current setting to the minimum; if theValue is greater than the maximum
  8932. setting, it sets the current setting to the maximum).
  8933.  
  8934. æKY GetCtlValue
  8935. æFc Controls.h
  8936. æT Function
  8937. æTN A960
  8938. æD pascal short GetCtlValue(ControlHandle theControl)
  8939.     = 0xA960; 
  8940. æDT short myVariable = GetCtlValue((ControlHandle) theControl);
  8941. æRI I-326, P-114, 171
  8942. æC 
  8943. GetCtlValue returns theControl’s current setting.
  8944.  
  8945. æKY SetCtlMin
  8946. æFc Controls.h
  8947. æT Function
  8948. æTN A964
  8949. æD pascal void SetCtlMin(ControlHandle theControl,short minValue)
  8950.     = 0xA964; 
  8951. æDT SetCtlMin((ControlHandle) theControl,(short) minValue);
  8952. æMM
  8953. æRI I-326
  8954. æC 
  8955. Assembly-language note:  The macro you invoke to call SetCtlMin from
  8956.                          assembly language is named _SetMinCtl.
  8957.  
  8958. SetCtlMin sets theControl’s minimum setting to minValue and redraws the control to
  8959. reflect the new range. If the control’s current setting is less than minValue, the
  8960. setting is changed to the new minimum.
  8961.  
  8962. æKY GetCtlMin
  8963. æFc Controls.h
  8964. æT Function
  8965. æTN A961
  8966. æD pascal short GetCtlMin(ControlHandle theControl)
  8967.     = 0xA961; 
  8968. æDT short myVariable = GetCtlMin((ControlHandle) theControl);
  8969. æRI I-327
  8970. æC  
  8971. Assembly-language note:  The macro you invoke to call GetCtlMin from
  8972.                          assembly language is named _GetMinCtl.
  8973.  
  8974. GetCtlMin returns theControl’s minimum setting.
  8975.  
  8976. æKY SetCtlMax
  8977. æFc Controls.h
  8978. æT Function
  8979. æTN A965
  8980. æD pascal void SetCtlMax(ControlHandle theControl,short maxValue)
  8981.     = 0xA965; 
  8982. æDT SetCtlMax((ControlHandle) theControl,(short) maxValue);
  8983. æMM
  8984. æRI I-327
  8985. æC 
  8986. Assembly-language note:  The macro you invoke to call SetCtlMax from
  8987.                          assembly language is named _SetMaxCtl.
  8988.  
  8989. SetCtlMax sets theControl’s maximum setting to maxValue and redraws the control to
  8990. reflect the new range. If the control’s current setting is greater than maxValue, the
  8991. setting is changed to the new maximum.
  8992.  
  8993. Note:  If you set the maximum setting of a scroll bar equal to its minimum
  8994.        setting, the control definition function will make the scroll bar
  8995.        inactive.
  8996.  
  8997. æKY GetCtlMax
  8998. æFc Controls.h
  8999. æT Function
  9000. æTN A962
  9001. æD pascal short GetCtlMax(ControlHandle theControl)
  9002.     = 0xA962; 
  9003. æDT short myVariable = GetCtlMax((ControlHandle) theControl);
  9004. æRI I-327
  9005. æC 
  9006. Assembly-language note:  The macro you invoke to call GetCtlMax from
  9007.                          assembly language is named _GetMaxCtl.
  9008.  
  9009. GetCtlMax returns theControl’s maximum setting.
  9010.  
  9011. æKY SetCRefCon
  9012. æFc Controls.h
  9013. æT Function
  9014. æTN A95B
  9015. æD pascal void SetCRefCon(ControlHandle theControl,long data)
  9016.     = 0xA95B; 
  9017. æDT SetCRefCon((ControlHandle) theControl,(long) data);
  9018. æRI I-327
  9019. æC 
  9020. SetCRefCon sets theControl’s reference value to the given data.
  9021.  
  9022. æKY GetCRefCon
  9023. æFc Controls.h
  9024. æT Function
  9025. æTN A95A
  9026. æD pascal long GetCRefCon(ControlHandle theControl)
  9027.     = 0xA95A; 
  9028. æDT long myVariable = GetCRefCon((ControlHandle) theControl);
  9029. æRI I-327
  9030. æC 
  9031. GetCRefCon returns theControl’s current reference value.
  9032.  
  9033. æKY SetCtlAction
  9034. æFc Controls.h
  9035. æT Function
  9036. æTN A96B
  9037. æD pascal void SetCtlAction(ControlHandle theControl,ProcPtr actionProc)
  9038.     = 0xA96B; 
  9039. æDT SetCtlAction((ControlHandle) theControl,(ProcPtr) actionProc);
  9040. æRI I-328
  9041. æC 
  9042. SetCtlAction sets theControl’s default action procedure to actionProc.
  9043.  
  9044. æKY GetCtlAction
  9045. æFc Controls.h
  9046. æT Function
  9047. æTN A96A
  9048. æD pascal ProcPtr GetCtlAction(ControlHandle theControl)
  9049.     = 0xA96A; 
  9050. æDT ProcPtr myVariable = GetCtlAction((ControlHandle) theControl);
  9051. æRI I-328, IV-53
  9052. æC  
  9053. GetCtlAction returns a pointer to theControl’s default action procedure, if any. (It
  9054. returns whatever is in that field of the control record.)
  9055.  
  9056. æKY DragControl
  9057. æFc Controls.h
  9058. æT Function
  9059. æTN A967
  9060. æD pascal void DragControl(ControlHandle theControl,Point startPt,const Rect *limitRect,
  9061.     const Rect *slopRect,short axis)
  9062.     = 0xA967; 
  9063. æDT DragControl((ControlHandle) theControl,(Point) startPt,(const Rect *) limitRect,(
  9064.     const Rect) * slopRect,(short) axis);
  9065. æMM
  9066. æRI I-325
  9067. æC 
  9068. Called with the mouse button down inside theControl, DragControl pulls a dotted
  9069. outline of the control around the screen, following the movements of the mouse until
  9070. the button is released. When the mouse button is released, DragControl calls MoveControl
  9071. to move the control to the location to which it was dragged.
  9072.  
  9073. Note:  Before beginning to follow the mouse, DragControl calls the control
  9074.        definition function to allow it to do its own “custom dragging” if
  9075.        it chooses. If the definition function doesn’t choose to do any
  9076.        custom dragging, DragControl uses the default method of dragging
  9077.        described here.
  9078.  
  9079. The startPt, limitRect, slopRect, and axis parameters have the same meaning as for
  9080. the Window Manager function DragGrayRgn. These parameters are reviewed briefly below;
  9081. see the description of DragGrayRgn in the Window Manager chapter for more details.
  9082.  
  9083.   •  StartPt is assumed to be the point where the mouse button was originally
  9084.      pressed, in the local coordinates of the control’s window.
  9085.   •  LimitRect limits the travel of the control’s outline, and should normally
  9086.      coincide with or be contained within the window’s content region.
  9087.   •  SlopRect allows the user some “slop” in moving the mouse; it should
  9088.      completely enclose limitRect.
  9089.   •  The axis parameter allows you to constrain the control’s motion to
  9090.      only one axis. It has one of the following values:
  9091.  
  9092.        CONST  noConstraint = 0;    {no constraint}
  9093.               hAxisOnly    = 1;    {horizontal axis only}
  9094.               vAxisOnly    = 2;    {vertical axis only}
  9095.  
  9096. Assembly-language note:  Like TrackControl, DragControl invokes the
  9097.                          macro _DragTheRgn, so you can use the global
  9098.                          variables DragHook and DragPattern.
  9099.  
  9100. æKY TestControl
  9101. æFc Controls.h
  9102. æT Function
  9103. æTN A966
  9104. æD pascal short TestControl(ControlHandle theControl,Point thePt)
  9105.     = 0xA966; 
  9106. æDT short myVariable = TestControl((ControlHandle) theControl,(Point) thePt);
  9107. æMM
  9108. æRI I-325
  9109. æC  
  9110. If theControl is visible and active, TestControl tests which part of the control
  9111. contains thePoint (in the local coordinates of the control’s window); it returns the
  9112. corresponding part code, or 0 if the point is outside the control. If the control is
  9113. invisible or inactive, TestControl returns 0. TestControl is called by FindControl
  9114. and TrackControl; normally you won’t need to call it yourself.
  9115.  
  9116. æKY TrackControl
  9117. æFc Controls.h
  9118. æT Function
  9119. æTN A968
  9120. æD pascal short TrackControl(ControlHandle theControl,Point thePoint,ProcPtr actionProc)
  9121.     = 0xA968; 
  9122. æDT short myVariable = TrackControl((ControlHandle) theControl,(Point) thePoint,(ProcPtr) actionProc);
  9123. æMM
  9124. æRI I-323, P-114, 184
  9125. æC 
  9126. When the mouse button is pressed in a visible, active control, the application should
  9127. call TrackControl with theControl equal to the control handle and startPt equal to
  9128. the point where the mouse button was pressed (in the local coordinates of the control’s
  9129. window). TrackControl follows the movements of the mouse and responds in whatever way
  9130. is appropriate until the mouse button is released; the exact response depends on the
  9131. type of control and the part of the control in which the mouse button was pressed. If
  9132. highlighting is appropriate, TrackControl does the highlighting, and undoes it before
  9133. returning. When the mouse button is released, TrackControl returns with the part code
  9134. if the mouse is in the same part of the control that it was originally in, or with 0
  9135. if not
  9136. (in which case the application should do nothing).
  9137.  
  9138. If the mouse button was pressed in an indicator, TrackControl drags a dotted outline
  9139. of it to follow the mouse. When the mouse button is released, TrackControl calls the
  9140. control definition function to reposition the control’s indicator. The control definition
  9141. function for scroll bars responds by redrawing the thumb, calculating the control’s
  9142. current setting based on the new relative position of the thumb, and storing the
  9143. current setting in the control record; for example, if the minimum and maximum settings
  9144. are 0 and 10, and the thumb is in the middle of the scroll bar, 5 is stored as the
  9145. current setting. The application must then scroll to the corresponding relative
  9146. position in the document.
  9147.  
  9148. TrackControl may take additional actions beyond highlighting the control or dragging
  9149. the indicator, depending on the value passed in the actionProc parameter, as described
  9150. below. The following tells you what to pass for the standard control types; for a
  9151. custom control, what you pass will depend on how the control is defined.
  9152.  
  9153.   •  If actionProc is NIL, TrackControl performs no additional actions. This
  9154.      is appropriate for simple buttons, check boxes, radio buttons, and the
  9155.      thumb of a scroll bar.
  9156.   •  ActionProc may be a pointer to an action procedure that defines some
  9157.      action to be performed repeatedly for as long as the user holds down
  9158.      the mouse button. (See below for details.)
  9159.   •  If actionProc is POINTER(–1), TrackControl looks in the control record
  9160.      for a pointer to the control’s default action procedure. If that field
  9161.      of the control record contains a procedure pointer, TrackControl uses
  9162.      the action procedure it points to; if the field contains POINTER (–1),
  9163.      TrackControl calls the control definition function to perform the
  9164.      necessary action. (If the field contains NIL, TrackControl does nothing.)
  9165.  
  9166. The action procedure in the control definition function is described in the section
  9167. “Defining Your Own Controls”. The following paragraphs describe only the action
  9168. procedure whose pointer is passed in the actionProc parameter or stored in the control
  9169. record.
  9170.  
  9171. If the mouse button was pressed in an indicator, the action procedure (if any) should
  9172. have no parameters. This procedure must allow for the fact that the mouse may not be
  9173. inside the original control part.
  9174.  
  9175. If the mouse button was pressed in a control part other than an indicator, the action
  9176. procedure should be of the form
  9177.  
  9178. PROCEDURE MyAction (theControl:  ControlHandle; partCode:  INTEGER);
  9179.  
  9180. In this case, TrackControl passes the control handle and the part code to the action
  9181. procedure. (It passes 0 in the partCode parameter if the mouse has moved outside the
  9182. original control part.) As an example of this type of action procedure, consider what
  9183. should happen when the mouse button is pressed in a scroll arrow or paging region in
  9184. a scroll bar. For these cases, your action procedure should examine the part code to
  9185. determine exactly where the mouse button was pressed, scroll up or down a line or
  9186. page as appropriate, and call SetCtlValue to change the control’s setting and redraw
  9187. the thumb.
  9188.  
  9189. Warning:  Since it has a different number of parameters depending on whether
  9190.           the mouse button was pressed in an indicator or elsewhere, the
  9191.           action procedure you pass to TrackControl (or whose pointer you
  9192.           store in the control record) can be set up for only one case or
  9193.           the other. If you store a pointer to a default action procedure
  9194.           in a control record, be sure it will be used only when appropriate
  9195.           for that type of action procedure. The only way to specify actions
  9196.           in response to all mouse-down events in a control, regardless of
  9197.           whether they’re in an indicator, is via the control definition
  9198.           function.
  9199.  
  9200. Assembly-language note:  If you store a pointer to a procedure in the global
  9201.                          variable DragHook, that procedure will be called
  9202.                          repeatedly (with no parameters) for as long as the
  9203.                          user holds down the mouse button. TrackControl
  9204.                          invokes the Window Manager macro _DragTheRgn,
  9205.                          which calls the DragHook procedure. _DragTheRgn
  9206.                          uses the pattern stored in the global variable
  9207.                          DragPattern for the dragged outline of the indicator.
  9208.  
  9209. æKY FindControl
  9210. æFc Controls.h
  9211. æT Function
  9212. æTN A96C
  9213. æD pascal short FindControl(Point thePoint,WindowPtr theWindow,ControlHandle *theControl)
  9214.     = 0xA96C; 
  9215. æDT short myVariable = FindControl((Point) thePoint,(WindowPtr) theWindow,(ControlHandle *) theControl);
  9216. æMM
  9217. æRI I-323, P-98, 114, 170
  9218. æC  
  9219. When the Window Manager function FindWindow reports that the mouse button was pressed
  9220. in the content region of a window, and the window contains controls, the application
  9221. should call FindControl with theWindow equal to the window pointer and thePoint equal
  9222. to the point where the mouse button was pressed (in the window’s local coordinates).
  9223. FindControl tells which of the window’s controls, if any, the mouse button was pressed
  9224. in:
  9225.  
  9226.   •  If it was pressed in a visible, active control, FindControl sets the
  9227.      whichControl parameter to the control handle and returns a part code
  9228.      identifying the part of the control that it was pressed in.
  9229.   •  If it was pressed in an invisible or inactive control, or not in any
  9230.      control, FindControl sets whichControl to NIL and returns 0 as its result.
  9231.  
  9232. Warning:  Notice that FindControl expects the mouse point in the window’s
  9233.           local coordinates, whereas FindWindow expects it in global
  9234.           coordinates. Always be sure to convert the point to local
  9235.           coordinates with the QuickDraw procedure GlobalToLocal before
  9236.           calling FindControl.
  9237.  
  9238. Note:  FindControl also returns NIL for whichControl and 0 as its result
  9239.        if the window is invisible or doesn’t contain the given point. In
  9240.        these cases, however, FindWindow wouldn’t have returned this window
  9241.        in the first place, so the situation should never arise.
  9242.  
  9243. æKY SetCtlColor
  9244. æFc Controls.h
  9245. æT Function
  9246. æTN AA43
  9247. æD pascal void SetCtlColor(ControlHandle theControl,CCTabHandle newColorTable)
  9248.     = 0xAA43; 
  9249. æDT SetCtlColor((ControlHandle) theControl,(CCTabHandle) newColorTable);
  9250. æMM
  9251. æRI V-222
  9252. æC 
  9253. [Macintosh II]
  9254.  
  9255. The SetCtlColor procedure sets or modifies a control’s color table.  If the control
  9256. currently has no auxiliary control record, a new one is created with the given color
  9257. table and added to the head of the auxiliary control list. If there is already an
  9258. auxiliary record for the control, its color table is replaced by the contents of
  9259. newColorTable.
  9260.  
  9261. If newColorTable has the same contents as the default color table, the
  9262. control’s existing auxiliary record and color table are removed from the auxiliary
  9263. control list and deallocated.  If theControl = NIL, the operation modifies the default
  9264. color table itself. If the control is visible, it will be redrawn by SetCtlColor
  9265. using the new color table.
  9266.  
  9267. æKY GetAuxCtl
  9268. æFc Controls.h
  9269. æT Function
  9270. æTN AA44
  9271. æD pascal Boolean GetAuxCtl(ControlHandle theControl,AuxCtlHandle *acHndl)
  9272.     = 0xAA44; 
  9273. æDT Boolean myVariable = GetAuxCtl((ControlHandle) theControl,(AuxCtlHandle *) acHndl);
  9274. æMM
  9275. æRI V-222
  9276. æC 
  9277. [Macintosh II]
  9278.  
  9279. The GetAuxCtl function returns a handle to a control’s AuxCtlRec:
  9280.  
  9281.   •  If the given control has its own color table, the function returns TRUE.
  9282.   •  If the control used the default color set, the function returns FALSE.
  9283.   •  If the control asked to receive the default color set (theControl = NIL),
  9284.      then the function returns TRUE.
  9285.  
  9286. æKY GetCVariant
  9287. æFc Controls.h
  9288. æT Function
  9289. æTN A809
  9290. æD pascal short GetCVariant(ControlHandle theControl)
  9291.     = 0xA809; 
  9292. æDT short myVariable = GetCVariant((ControlHandle) theControl);
  9293. æRI V-222
  9294. æC 
  9295. [Macintosh Plus, Macintosh SE, and Macintosh II]
  9296.  
  9297. The GetVariant function returns the variant control value for the control described
  9298. by theControl. This value was formerly stored in the high four bits of the control
  9299. defproc handle; for future compatibility, use the GetCVariant routine to access this
  9300. value.
  9301.  
  9302. æKY dragcontrol
  9303. æFc Controls.h
  9304. æT Function
  9305. æD void dragcontrol(ControlHandle theControl,Point *startPt,const Rect *limitRect,
  9306.     const Rect *slopRect,short axis); 
  9307. æDT dragcontrol((ControlHandle) theControl,(Point *) startPt,(const Rect *) limitRect,(
  9308.     const Rect) * slopRect,(short) axis);
  9309. æMM
  9310. æRI I-325
  9311. æC 
  9312. Called with the mouse button down inside theControl, DragControl pulls a dotted
  9313. outline of the control around the screen, following the movements of the mouse until
  9314. the button is released. When the mouse button is released, DragControl calls MoveControl
  9315. to move the control to the location to which it was dragged.
  9316.  
  9317. Note:  Before beginning to follow the mouse, DragControl calls the control
  9318.        definition function to allow it to do its own “custom dragging” if
  9319.        it chooses. If the definition function doesn’t choose to do any
  9320.        custom dragging, DragControl uses the default method of dragging
  9321.        described here.
  9322.  
  9323. The startPt, limitRect, slopRect, and axis parameters have the same meaning as for
  9324. the Window Manager function DragGrayRgn. These parameters are reviewed briefly below;
  9325. see the description of DragGrayRgn in the Window Manager chapter for more details.
  9326.  
  9327.   •  StartPt is assumed to be the point where the mouse button was originally
  9328.      pressed, in the local coordinates of the control’s window.
  9329.   •  LimitRect limits the travel of the control’s outline, and should normally
  9330.      coincide with or be contained within the window’s content region.
  9331.   •  SlopRect allows the user some “slop” in moving the mouse; it should
  9332.      completely enclose limitRect.
  9333.   •  The axis parameter allows you to constrain the control’s motion to
  9334.      only one axis. It has one of the following values:
  9335.  
  9336.        CONST  noConstraint = 0;    {no constraint}
  9337.               hAxisOnly    = 1;    {horizontal axis only}
  9338.               vAxisOnly    = 2;    {vertical axis only}
  9339.  
  9340. Assembly-language note:  Like TrackControl, DragControl invokes the
  9341.                          macro _DragTheRgn, so you can use the global
  9342.                          variables DragHook and DragPattern.
  9343.  
  9344. æKY newcontrol
  9345. æFc Controls.h
  9346. æT Function
  9347. æTN A954
  9348. æD ControlHandle newcontrol(WindowPtr theWindow,const Rect *boundsRect,char *title,
  9349.     Boolean visible,short value,short min,short max,short procID,long refCon); 
  9350. æDT ControlHandle myVariable = newcontrol((WindowPtr) theWindow,(const Rect *) boundsRect,(char *) title,()
  9351.     Boolean visible,(short) value,(short) min,(short) max,(short) procID,(long) refCon);
  9352. æMM
  9353. æRI I-319, P-112, 114, 177
  9354. æC  
  9355. NewControl creates a control, adds it to the beginning of theWindow’s control list,
  9356. and returns a handle to the new control. The values passed as parameters are stored
  9357. in the corresponding fields of the control record, as described below. The field that
  9358. determines highlighting is set to 0 (no highlighting) and the pointer to the default
  9359. action procedure is set to NIL (none).
  9360.  
  9361. Note:  The control definition function may do additional initialization,
  9362.        including changing any of the fields of the control record. The only
  9363.        standard control for which additional initialization is done is the
  9364.        scroll bar; its control definition function allocates space for a
  9365.        region to hold the thumb and stores the region handle in the
  9366.        contrlData field of the control record.
  9367.  
  9368. TheWindow is the window the new control will belong to. All coordinates pertaining to
  9369. the control will be interpreted in this window’s local coordinate system.
  9370.  
  9371. BoundsRect, given in theWindow’s local coordinates, is the rectangle that encloses
  9372. the control and thus determines its size and location. Note the following about the
  9373. enclosing rectangle for the standard controls:
  9374.  
  9375.   •  Simple buttons are drawn to fit the rectangle exactly. (The control
  9376.      definition function calls the QuickDraw procedure FrameRoundRect.) To
  9377.      allow for the tallest characters in the system font, there should be
  9378.      at least a 20-point difference between the top and bottom coordinates
  9379.      of the rectangle.
  9380.   •  For check boxes and radio buttons, there should be at least a 16-point
  9381.      difference between the top and bottom coordinates.
  9382.   •  By convention, scroll bars are 16 pixels wide, so there should be a
  9383.      16-point difference between the left and right (or top and bottom)
  9384.      coordinates. (If there isn’t, the scroll bar will be scaled to fit
  9385.      the rectangle.) A standard scroll bar should be at least 48 pixels
  9386.      long, to allow room for the scroll arrows and thumb.
  9387.  
  9388. Title is the control’s title, if any (if none, you can just pass the empty string as
  9389. the title). Be sure the title will fit in the control’s enclosing rectangle; if it
  9390. won’t it will be truncated on the right for check boxes and radio buttons, or centered
  9391. and truncated on both ends for simple buttons.
  9392.  
  9393. Note:  Some non-Roman systems write text from right-to-left, in which
  9394.        case radio buttons and check boxes are drawn with their titles
  9395.        on the left of the control.  They are also truncated on the left.
  9396.        See the Script Manager chapter for more information.
  9397.  
  9398. If the visible parameter is TRUE, NewControl draws the control.
  9399.  
  9400. Note:  It does not use the standard window updating mechanism, but
  9401.        instead draws the control immediately in the window.
  9402.  
  9403. The min and max parameters define the control’s range of possible settings; the value
  9404. parameter gives the initial setting. For controls that don’t retain a setting, such
  9405. as buttons, the values you supply for these parameters will be stored in the control
  9406. record but will never be used. So it doesn’t matter what values you give for those
  9407. controls—0 for all three parameters will do. For controls that just retain an on-or-off
  9408. setting, such as check boxes or radio buttons, min should be 0 (meaning the control
  9409. is off) and max should be 1
  9410. (meaning it’s on). For dials, you can specify whatever values are appropriate for
  9411. min, max, and value.
  9412.  
  9413. ProcID is the control definition ID, which leads to the control definition function
  9414. for this type of control. (The function is read into memory if it
  9415. isn’t already in memory.) The control definition IDs for the standard control types
  9416. are listed above under “Controls and Resources”. Control definition IDs for custom
  9417. control types are discussed later under “Defining Your Own Controls”.
  9418.  
  9419. RefCon is the control’s reference value, set and used only by your application.
  9420.  
  9421. æKY findcontrol
  9422. æFc Controls.h
  9423. æT Function
  9424. æD short findcontrol(Point *thePoint,WindowPtr theWindow,ControlHandle *theControl); 
  9425. æDT short myVariable = findcontrol((Point *) thePoint,(WindowPtr) theWindow,(ControlHandle *) theControl);
  9426. æMM
  9427. æRI I-323, P-98, 114, 170
  9428. æC  
  9429. When the Window Manager function FindWindow reports that the mouse button was pressed
  9430. in the content region of a window, and the window contains controls, the application
  9431. should call FindControl with theWindow equal to the window pointer and thePoint equal
  9432. to the point where the mouse button was pressed (in the window’s local coordinates).
  9433. FindControl tells which of the window’s controls, if any, the mouse button was pressed
  9434. in:
  9435.  
  9436.   •  If it was pressed in a visible, active control, FindControl sets the
  9437.      whichControl parameter to the control handle and returns a part code
  9438.      identifying the part of the control that it was pressed in.
  9439.   •  If it was pressed in an invisible or inactive control, or not in any
  9440.      control, FindControl sets whichControl to NIL and returns 0 as its result.
  9441.  
  9442. Warning:  Notice that FindControl expects the mouse point in the window’s
  9443.           local coordinates, whereas FindWindow expects it in global
  9444.           coordinates. Always be sure to convert the point to local
  9445.           coordinates with the QuickDraw procedure GlobalToLocal before
  9446.           calling FindControl.
  9447.  
  9448. Note:  FindControl also returns NIL for whichControl and 0 as its result
  9449.        if the window is invisible or doesn’t contain the given point. In
  9450.        these cases, however, FindWindow wouldn’t have returned this window
  9451.        in the first place, so the situation should never arise.
  9452.  
  9453. æKY getctitle
  9454. æFc Controls.h
  9455. æT Function
  9456. æD void getctitle(ControlHandle theControl,char *title); 
  9457. æDT getctitle((ControlHandle) theControl,(char *) title);
  9458. æRI I-321
  9459. æC 
  9460. GetCTitle returns theControl’s title as the value of the title parameter.
  9461.  
  9462. æKY setctitle
  9463. æFc Controls.h
  9464. æT Function
  9465. æD void setctitle(ControlHandle theControl,char *title); 
  9466. æDT setctitle((ControlHandle) theControl,(char *) title);
  9467. æMM
  9468. æRI I-321
  9469. æC  
  9470. SetCTitle sets theControl’s title to the given string and redraws the control.
  9471.  
  9472. æKY trackcontrol
  9473. æFc Controls.h
  9474. æT Function
  9475. æD short trackcontrol(ControlHandle theControl,Point *thePoint,ProcPtr actionProc); 
  9476. æDT short myVariable = trackcontrol((ControlHandle) theControl,(Point *) thePoint,(ProcPtr) actionProc);
  9477. æMM
  9478. æRI I-323, P-114, 184
  9479. æC 
  9480. When the mouse button is pressed in a visible, active control, the application should
  9481. call TrackControl with theControl equal to the control handle and startPt equal to
  9482. the point where the mouse button was pressed (in the local coordinates of the control’s
  9483. window). TrackControl follows the movements of the mouse and responds in whatever way
  9484. is appropriate until the mouse button is released; the exact response depends on the
  9485. type of control and the part of the control in which the mouse button was pressed. If
  9486. highlighting is appropriate, TrackControl does the highlighting, and undoes it before
  9487. returning. When the mouse button is released, TrackControl returns with the part code
  9488. if the mouse is in the same part of the control that it was originally in, or with 0
  9489. if not
  9490. (in which case the application should do nothing).
  9491.  
  9492. If the mouse button was pressed in an indicator, TrackControl drags a dotted outline
  9493. of it to follow the mouse. When the mouse button is released, TrackControl calls the
  9494. control definition function to reposition the control’s indicator. The control definition
  9495. function for scroll bars responds by redrawing the thumb, calculating the control’s
  9496. current setting based on the new relative position of the thumb, and storing the
  9497. current setting in the control record; for example, if the minimum and maximum settings
  9498. are 0 and 10, and the thumb is in the middle of the scroll bar, 5 is stored as the
  9499. current setting. The application must then scroll to the corresponding relative
  9500. position in the document.
  9501.  
  9502. TrackControl may take additional actions beyond highlighting the control or dragging
  9503. the indicator, depending on the value passed in the actionProc parameter, as described
  9504. below. The following tells you what to pass for the standard control types; for a
  9505. custom control, what you pass will depend on how the control is defined.
  9506.  
  9507.   •  If actionProc is NIL, TrackControl performs no additional actions. This
  9508.      is appropriate for simple buttons, check boxes, radio buttons, and the
  9509.      thumb of a scroll bar.
  9510.   •  ActionProc may be a pointer to an action procedure that defines some
  9511.      action to be performed repeatedly for as long as the user holds down
  9512.      the mouse button. (See below for details.)
  9513.   •  If actionProc is POINTER(–1), TrackControl looks in the control record
  9514.      for a pointer to the control’s default action procedure. If that field
  9515.      of the control record contains a procedure pointer, TrackControl uses
  9516.      the action procedure it points to; if the field contains POINTER (–1),
  9517.      TrackControl calls the control definition function to perform the
  9518.      necessary action. (If the field contains NIL, TrackControl does nothing.)
  9519.  
  9520. The action procedure in the control definition function is described in the section
  9521. “Defining Your Own Controls”. The following paragraphs describe only the action
  9522. procedure whose pointer is passed in the actionProc parameter or stored in the control
  9523. record.
  9524.  
  9525. If the mouse button was pressed in an indicator, the action procedure (if any) should
  9526. have no parameters. This procedure must allow for the fact that the mouse may not be
  9527. inside the original control part.
  9528.  
  9529. If the mouse button was pressed in a control part other than an indicator, the action
  9530. procedure should be of the form
  9531.  
  9532. PROCEDURE MyAction (theControl:  ControlHandle; partCode:  INTEGER);
  9533.  
  9534. In this case, TrackControl passes the control handle and the part code to the action
  9535. procedure. (It passes 0 in the partCode parameter if the mouse has moved outside the
  9536. original control part.) As an example of this type of action procedure, consider what
  9537. should happen when the mouse button is pressed in a scroll arrow or paging region in
  9538. a scroll bar. For these cases, your action procedure should examine the part code to
  9539. determine exactly where the mouse button was pressed, scroll up or down a line or
  9540. page as appropriate, and call SetCtlValue to change the control’s setting and redraw
  9541. the thumb.
  9542.  
  9543. Warning:  Since it has a different number of parameters depending on whether
  9544.           the mouse button was pressed in an indicator or elsewhere, the
  9545.           action procedure you pass to TrackControl (or whose pointer you
  9546.           store in the control record) can be set up for only one case or
  9547.           the other. If you store a pointer to a default action procedure
  9548.           in a control record, be sure it will be used only when appropriate
  9549.           for that type of action procedure. The only way to specify actions
  9550.           in response to all mouse-down events in a control, regardless of
  9551.           whether they’re in an indicator, is via the control definition
  9552.           function.
  9553.  
  9554. Assembly-language note:  If you store a pointer to a procedure in the global
  9555.                          variable DragHook, that procedure will be called
  9556.                          repeatedly (with no parameters) for as long as the
  9557.                          user holds down the mouse button. TrackControl
  9558.                          invokes the Window Manager macro _DragTheRgn,
  9559.                          which calls the DragHook procedure. _DragTheRgn
  9560.                          uses the pattern stored in the global variable
  9561.                          DragPattern for the dragged outline of the indicator.
  9562.  
  9563. æKY testcontrol
  9564. æFc Controls.h
  9565. æT Function
  9566. æD short testcontrol(ControlHandle theControl,Point *thePt); 
  9567. æDT short myVariable = testcontrol((ControlHandle) theControl,(Point *) thePt);
  9568. æMM
  9569. æRI I-325
  9570. æC  
  9571. If theControl is visible and active, TestControl tests which part of the control
  9572. contains thePoint (in the local coordinates of the control’s window); it returns the
  9573. corresponding part code, or 0 if the point is outside the control. If the control is
  9574. invisible or inactive, TestControl returns 0. TestControl is called by FindControl
  9575. and TrackControl; normally you won’t need to call it yourself.
  9576.  
  9577.  
  9578. æKY Ctype.h
  9579. æKL _tolower
  9580. _toupper
  9581. isalnum
  9582. isalpha
  9583. isascii
  9584. iscntrl
  9585. isdigit
  9586. isgraph
  9587. islower
  9588. isprint
  9589. ispunct
  9590. isspace
  9591. isupper
  9592. isxdigit
  9593. toascii
  9594. tolower
  9595. toupper
  9596.  
  9597. æKY isalpha
  9598. isupper
  9599. islower
  9600. isdigit
  9601. isxdigit
  9602. isalnum
  9603. isspace
  9604. ispunct
  9605. isprint
  9606. isgraph
  9607. iscntrl
  9608. isascii
  9609. æFc CType.h
  9610. æC These functions tell whether a given character is in one of 
  9611. several categories: alphabetical, uppercase, lowercase, digit, 
  9612. hex digit, white-space, punctuation mark, printing, graphic, or 
  9613. control. A separate function is provided for each category.
  9614.  
  9615.                           Synopsis
  9616.  
  9617. #include <CType.h>
  9618. int isalpha(int c);
  9619. int isupper(int c);
  9620. int islower(int c);
  9621. int isdigit(int c);
  9622. int isxdigit(int c);
  9623. int isalnum(int c);
  9624. int isspace(int c);
  9625. int ispunct(int c);
  9626. int isprint(int c);
  9627. int isgraph(int c);
  9628. int iscntrl(int c);
  9629. int isascii(int c);
  9630.  
  9631.                            Description
  9632.  
  9633. These macros return nonzero for true, zero for false, 
  9634. depending on the corresponding integer value of the given 
  9635. character. The isascii macro is defined on all integer values; 
  9636. the rest are defined only where isascii is true and on the 
  9637. single non-ASCII value EOF(–1).  
  9638.  
  9639. Table 3-1 shows when these macros return the value true.
  9640. Table 3-1    Character-testing macros
  9641.  
  9642. Macro    Returns true if
  9643.  
  9644. isascii; c is an ASCII character code lower than128.
  9645. isalpha; c is a letter [A–Z] or [a–z].
  9646. isupper; c is an uppercase letter [A–Z].
  9647. islower; c is a lowercase letter [a–z].
  9648. isdigit; c is a digit [0–9].
  9649. isxdigit; c is a hexadecimal digit [0–9], [A–F], or [a–f].
  9650. isalnum; c is alphanumeric (letter or digit).
  9651. isspace; c is a space, tab, return, new line, vertical tab, or form feed.
  9652. ispunct; c is a punctuation character (neither control nor alphanumeric).
  9653. isprint; c is a printing character, space (32) through tilde (126).
  9654. isgraph; c is a printing character, similar to isprint except false for space.
  9655. iscntrl; c is a delete character (127) or an ordinary control character 
  9656.  (less than 32).
  9657.  
  9658.                            Note
  9659.  
  9660. These macros do not support the Macintosh extended character 
  9661. set. For values outside the domain, the result is undefined.
  9662.  
  9663.                            Warning
  9664.  
  9665. If c is not in the domain of the function, the result is undefined.  
  9666.  
  9667. See also
  9668. Character case
  9669.  
  9670. æKY toupper
  9671. tolower
  9672. _toupper
  9673. _tolower
  9674. toascii
  9675. æFc CType.h
  9676. æC The first four of these routines change the case of a character. 
  9677. The toascii function converts any character to an ASCII character.
  9678.  
  9679.                           Synopsis
  9680.  
  9681. #include <CType.h>
  9682. int toupper(int c);
  9683. int tolower(int c);
  9684. int _toupper(int c);
  9685. int _tolower(int c);
  9686. int toascii(int c);
  9687.  
  9688.                            Description
  9689.  
  9690. The toupper; and tolower; functions have as their domain the 
  9691. set of ASCII characters (0 through 127) and the constant EOF (–
  9692. 1). If parameter c to toupper represents a lowercase letter, the 
  9693. result is the corresponding uppercase letter. If parameter c to 
  9694. tolower represents an uppercase letter, the result is the 
  9695. corresponding lowercase letter. All other parameters in the 
  9696. domain are returned unchanged.
  9697.  
  9698. The _toupper; and _tolower; macros produce the same 
  9699. results as functions toupper and tolower but have restricted 
  9700. domains and are faster. Macro _toupper requires a lowercase 
  9701. letter as its parameter; its result is the corresponding 
  9702. uppercase letter. Macro _tolower requires an uppercase letter 
  9703. as its parameter; its result is the corresponding lowercase 
  9704. letter. Parameters outside the domain cause undefined results.
  9705. The toascii; macro converts c by clearing all bits that are not 
  9706. part of a standard ASCII character. It is used for compatibility 
  9707. with other systems.
  9708.  
  9709.                            Note
  9710.  
  9711. These routines do not support the Macintosh extended 
  9712. character set (with values greater than 0x7F). For values 
  9713. outside the stated domain, the result is undefined.
  9714.  
  9715.                            Warning
  9716.  
  9717. The _toupper and _tolower macros must be used with care: 
  9718. parameters outside their respective domains cause undefined 
  9719. results. The _toupper macro requires a lowercase letter as its 
  9720. parameter: the _tolower macro requires an uppercase letter as 
  9721. its parameter.
  9722.  
  9723. See also
  9724. Character testing
  9725.  
  9726.  
  9727. æKY isalphaæ
  9728. æDT 
  9729. int myVariable = isalpha((int) c);
  9730.  
  9731. æKY isupperæ
  9732. æDT 
  9733. int myVariable = isupper((int) c);
  9734.  
  9735. æKY isloweræ
  9736. æDT 
  9737. int myVariable = islower((int) c);
  9738.  
  9739. æKY isdigitæ
  9740. æDT 
  9741. int myVariable = isdigit((int) c);
  9742.  
  9743. æKY isxdigitæ
  9744. æDT 
  9745. int myVariable = isxdigit((int) c);
  9746.  
  9747. æKY isalnumæ
  9748. æDT 
  9749. int myVariable = isalnum((int) c);
  9750.  
  9751. æKY isspaceæ
  9752. æDT 
  9753. int myVariable = isspace((int) c);
  9754.  
  9755.  
  9756. æKY ispunctæ
  9757. æDT 
  9758. int myVariable = ispunct((int) c);
  9759.  
  9760.  
  9761. æKY isprintæ
  9762. æDT 
  9763. int myVariable = isprint((int) c);
  9764.  
  9765. æKY isgraphæ
  9766. æDT 
  9767. int myVariable = isgraph((int) c);
  9768.  
  9769. æKY iscntrlæ
  9770. æDT 
  9771. int myVariable = iscntrl((int) c);
  9772.  
  9773. æKY isasciiæ
  9774. æDT 
  9775. int my Variable = isascii((int) c);
  9776.  
  9777.  
  9778. æKY toupperæ
  9779. æDT 
  9780. int myVariable = toupper((int) c);
  9781.  
  9782. æKY toloweræ
  9783. æDT 
  9784. int myVariable = tolower((int) c);
  9785.  
  9786. æKY _toupperæ
  9787. æDT 
  9788. int myVariable =  _toupper((int) c);
  9789.  
  9790.  
  9791. æKY _toloweræ
  9792. æDT 
  9793. int myVariable =  _toupper((int) c);
  9794.  
  9795.  
  9796. æKY toasciiæ
  9797. æDT 
  9798. int myVariable = toascii((int) c);
  9799.  
  9800.  
  9801. æKY CursorCtl.h
  9802. æKL Hide_Cursor
  9803. InitCursorCtl
  9804. RotateCursor
  9805. Show_Cursor
  9806. SpinCursor
  9807.  
  9808. acur
  9809. Acur
  9810. acurHandle
  9811. acurPtr
  9812. ARROW_CURSOR
  9813. CROSS_CURSOR
  9814. Cursors
  9815. HIDDEN_CURSOR
  9816. I_BEAM_CURSOR
  9817. PLUS_CURSOR
  9818. WATCH_CURSOR
  9819.  
  9820. æKY Acur
  9821. acur
  9822. acurPtr
  9823. acurHandle
  9824. æFc CursorCtl.h
  9825. æT struct
  9826. æD struct Acur {
  9827.     short n;        /*Number of cursors ("frames of film")*/
  9828.     short index;    /* Next frame to show <for internal use>*/
  9829.     short frame1;   /*'CURS' resource id for frame #1*/
  9830.     short fill1;    /*<for internal use>*/
  9831.     short frame2;   /*'CURS' resource id for frame #2*/
  9832.     short fill2;    /*<for internal use>*/
  9833.     short frameN;   /*'CURS' resource id for frame #N*/
  9834.     short fillN;    /*<for internal use>*/
  9835. };
  9836. typedef struct Acur acur,*acurPtr,**acurHandle;
  9837.  
  9838. æKY Cursors
  9839. HIDDEN_CURSOR
  9840. I_BEAM_CURSOR
  9841. CROSS_CURSOR
  9842. PLUS_CURSOR
  9843. WATCH_CURSOR
  9844. ARROW_CURSOR
  9845. æFc CursorCtl.h
  9846. æD enum {HIDDEN_CURSOR,I_BEAM_CURSOR,CROSS_CURSOR,PLUS_CURSOR,WATCH_CURSOR,
  9847. ARROW_CURSOR}Cursors;
  9848. typedef unsigned char Cursors;
  9849.  
  9850. æKY Hide_Cursor
  9851. æFc CursorCtl.h
  9852. æT Function
  9853. æD pascal void Hide_Cursor(void);
  9854. æDT Hide_Cursor();
  9855. æC 
  9856. /* 
  9857.     Hide the cursor if it is showing.This is this unit's call to the Mac
  9858.     HideCursor routine.Thus the Mac cursor level is decremented by one when this
  9859.     routine is called.
  9860. */
  9861.  
  9862. æKY InitCursorCtl
  9863. æFc CursorCtl.h
  9864. æT Function
  9865. æD pascal void InitCursorCtl(acurHandle newCursors);
  9866. æDT InitCursorCtl((acurHandle)newCursors);
  9867. æC 
  9868. /* 
  9869.     Initialize the CursorCtl unit. This should be called once prior to calling
  9870.     RotateCursor or SpinCursor. It need not be called if only Hide_Cursor or
  9871.     Show_Cursor are used. If NewCursors is NULL, InitCursorCtl loads in the
  9872.     'acur' resource and the 'CURS' resources specified by the 'acur' resource
  9873.     ids.  If any of the resources cannot be loaded, the cursor will not be
  9874.     changed.
  9875.     
  9876.     The 'acur' resource is assumed to either be in the currently running tool or
  9877.     application, or the MPW Shell for a tool, or in the System file.  The 'acur'
  9878.     resource id must be 0 for a tool or application, 1 for the Shell, and 2 for
  9879.     the System file.
  9880.     
  9881.     If NewCursors is not NULL, it is ASSUMED to be a handle to an 'acur' formatted
  9882.     resource designated by the caller and it will be used instead of doing a
  9883.     GetResource on 'acur'. Note, if RotateCursor or SpinCursor are called without
  9884.     calling InitCursorCtl, then RotateCursor and SpinCursor will do the call for
  9885.     the user the first time it is called.  However, the possible disadvantage of
  9886.     using this technique is that the resource memory allocated may have
  9887.     undesirable affect (fragmentation?) on the application. Using InitCursorCtl
  9888.     has the advantage of causing the allocation at a specific time determined by
  9889.     the user.
  9890.     
  9891.     Caution: InitCursorCtl MODIFIES the 'acur' resource in memory.  Specifically,
  9892.     it changes each FrameN/fillN integer pair to a handle to the corresponding
  9893.     'CURS' resource also in memory.  Thus if NewCursors is not NULL when
  9894.     InitCursorCtl is called, the caller must guarantee NewCursors always points to
  9895.     a "fresh" copy of an 'acur' resource.  This need only be of concern to a
  9896.     caller who wants to repeatly use multiple 'acur' resources during execution of
  9897.     their programs.
  9898. */
  9899.  
  9900. æKY RotateCursor
  9901. æFc CursorCtl.h
  9902. æT Function
  9903. æD pascal void RotateCursor(long counter);
  9904. æDT RotateCursor((long)counter);
  9905. æC 
  9906. /* 
  9907.     RotateCursor is called to rotate the "I am active" "beach ball" cursor, or to
  9908.     animate whatever sequence of cursors set up by InitCursorCtl. The next cursor
  9909.     ("frame") is used when Counter % 32 = 0 (Counter is some kind of incrementing
  9910.     or decrementing index maintained by the caller). A positive counter sequences
  9911.     forward through the cursors (e.g., it rotates the "beach ball" cursor
  9912.     clockwise), and a negative cursor sequences through the cursors backwards
  9913.     (e.g., it rotates the "beach ball" cursor counterclockwise).  Note,
  9914.     RotateCursor just does a Mac SetCursor call for the proper cursor picture.
  9915.       It is assumed the cursor is visible from a prior Show_Cursor call.
  9916. */
  9917.  
  9918. æKY Show_Cursor
  9919. æFc CursorCtl.h
  9920. æT Function
  9921. æD pascal void Show_Cursor(Cursors cursorKind);
  9922. æDT Show_Cursor((Cursors)cursorKind);
  9923. æC 
  9924. /* 
  9925.     Increment the cursor level, which may have been decremented by Hide_Cursor,
  9926.     and display the specified cursor if the level becomes 0 (it is never
  9927.     incremented beyond 0).The CursorKind is the kind of cursor to show.  It is
  9928.     one of the values HIDDEN_CURSOR, I_BEAM_CURSOR, CROSS_CURSOR, PLUS_CURSOR,
  9929.     WATCH_CURSOR, and ARROW_CURSOR. Except for HIDDEN_CURSOR, a Mac SetCursor is 
  9930.     done for the specified cursor prior to doing a ShowCursor.  HIDDEN_CURSOR just
  9931.     causes a ShowCursor call.  Note, ARROW_CURSOR will only work correctly if
  9932.     there is already a grafPort set up pointed to by 0(A5).
  9933. */
  9934.  
  9935. æKY SpinCursor
  9936. æFc CursorCtl.h
  9937. æT Function
  9938. æD pascal void SpinCursor(short increment);
  9939. æDT SpinCursor((short)increment);
  9940. æC 
  9941. /* 
  9942.     SpinCursor is similar in function to RotateCursor, except that instead of
  9943.     passing a counter, an Increment is passed an added to a counter maintained
  9944.     here.  SpinCursor is provided for those users who do not happen to have a
  9945.     convenient counter handy but still want to use the spinning "beach ball"
  9946.     cursor, or any sequence of cursors set up by InitCursorCtl.  A positive 
  9947.     increment sequences forward through the curos (rotating the "beach ball"
  9948.     cursor clockwise), and a negative increment sequences backward through the
  9949.     cursors (rotating the "beach ball" cursor counter-clockwise).  A zero value
  9950.     for the increment resets the counter to zero.  Note, it is the increment, and
  9951.     not the value of the counter that determines the sequencing direction of the
  9952.     cursor (and hence the spin direction of the "beach ball" cursor).
  9953. */
  9954.  
  9955.  
  9956.  
  9957. æKY DatabaseAccess.h
  9958. æKL DBBreak
  9959. DBDisposeQuery
  9960. DBEnd
  9961. DBExec
  9962. DBGetConnInfo
  9963. DBGetErr
  9964. DBGetItem
  9965. DBGetNewQuery
  9966. DBGetQueryResults
  9967. DBGetResultHandler
  9968. DBGetSessionNum
  9969. DBInit
  9970. DBInstallResultHandler
  9971. DBKill
  9972. DBRemoveResultHandler
  9973. DBResultsToText
  9974. DBSend
  9975. DBSendItem
  9976. DBStartQuery
  9977. DBState
  9978. DBUnGetItem
  9979. InitDBPack
  9980. QuitDBPack
  9981.  
  9982. DBAsyncParamBlockRec
  9983. DBAsyncParmBlkPtr
  9984. DBColInfoRecord
  9985. DBType
  9986. kDBAboutToInit
  9987. kDBExecComplete
  9988. kDBGetItemComplete
  9989. kDBGetQueryResultsComplete
  9990. kDBInitComplete
  9991. kDBLastColFlag
  9992. kDBSendComplete
  9993. kDBStartQueryComplete
  9994. kDBUpdateWind
  9995. kDBWaitForever
  9996. QueryHandle
  9997. QueryListHandle
  9998. QueryPtr
  9999. QueryRecord
  10000. rcDBAsyncNotSupp
  10001. rcDBBadAsyncPB
  10002. rcDBBadDDEV
  10003. rcDBBadSessID
  10004. rcDBBadSessNum
  10005. rcDBBadType
  10006. rcDBBreak
  10007. rcDBError
  10008. rcDBExec
  10009. rcDBNoHandler
  10010. rcDBNull
  10011. rcDBPackNotInited
  10012. rcDBValue
  10013. rcDBWrongVersion
  10014. ResListElem
  10015. ResListHandle
  10016. ResultsRecord
  10017. typeAnyType
  10018. typeBoolean
  10019. typeChar
  10020. typeColBreak
  10021. typeDate
  10022. typeDecimal
  10023. typeDiscard
  10024. typeFloat
  10025. typeInteger
  10026. typeLBin
  10027. typeLChar
  10028. typeMoney
  10029. typeNone
  10030. typeRowBreak
  10031. typeSMFloat
  10032. typeSMInt
  10033. typeTime
  10034. typeTimeStamp
  10035. typeUnknown
  10036. typeVBin
  10037. typeVChar
  10038.  
  10039. æKY rcDBNull
  10040. æFc DatabaseAccess.h
  10041. æT #define
  10042. æD 
  10043. /*  OSErr error and status codes  */
  10044.  
  10045. #define rcDBNull -800
  10046. æC 
  10047.  
  10048. æKY rcDBValue
  10049. æFc DatabaseAccess.h
  10050. æT #define
  10051. æD #define rcDBValue -801
  10052. æC 
  10053.  
  10054. æKY rcDBError
  10055. æFc DatabaseAccess.h
  10056. æT #define
  10057. æD #define rcDBError -802
  10058. æC 
  10059.  
  10060. æKY rcDBBadType
  10061. æFc DatabaseAccess.h
  10062. æT #define
  10063. æD #define rcDBBadType -803
  10064. æC 
  10065.  
  10066. æKY rcDBBreak
  10067. æFc DatabaseAccess.h
  10068. æT #define
  10069. æD #define rcDBBreak -804
  10070. æC 
  10071.  
  10072. æKY rcDBExec
  10073. æFc DatabaseAccess.h
  10074. æT #define
  10075. æD #define rcDBExec -805
  10076. æC 
  10077.  
  10078. æKY rcDBBadSessID
  10079. æFc DatabaseAccess.h
  10080. æT #define
  10081. æD #define rcDBBadSessID -806
  10082. æC 
  10083.  
  10084. æKY rcDBBadSessNum
  10085. æFc DatabaseAccess.h
  10086. æT #define
  10087. æD #define rcDBBadSessNum -807 /* bad session number for DBGetConnInfo */
  10088. æC 
  10089.  
  10090. æKY rcDBBadDDEV
  10091. æFc DatabaseAccess.h
  10092. æT #define
  10093. æD #define rcDBBadDDEV -808 /* bad ddev specified on DBInit */
  10094. æC 
  10095.  
  10096. æKY rcDBAsyncNotSupp
  10097. æFc DatabaseAccess.h
  10098. æT #define
  10099. æD #define rcDBAsyncNotSupp -809 /* ddev does not support async calls */
  10100. æC 
  10101.  
  10102. æKY rcDBBadAsyncPB
  10103. æFc DatabaseAccess.h
  10104. æT #define
  10105. æD #define rcDBBadAsyncPB -810 /* tried to kill a bad pb */
  10106. æC 
  10107.  
  10108. æKY rcDBNoHandler
  10109. æFc DatabaseAccess.h
  10110. æT #define
  10111. æD #define rcDBNoHandler -811 /* no app handler for specified data type */
  10112. æC 
  10113.  
  10114. æKY rcDBWrongVersion
  10115. æFc DatabaseAccess.h
  10116. æT #define
  10117. æD #define rcDBWrongVersion -812 /* incompatible versions */
  10118. æC 
  10119.  
  10120. æKY rcDBPackNotInited
  10121. æFc DatabaseAccess.h
  10122. æT #define
  10123. æD #define rcDBPackNotInited -813 /* attempt to call other routine before InitDBPack */
  10124. æC 
  10125.  
  10126. æKY kDBUpdateWind
  10127. æFc DatabaseAccess.h
  10128. æT #define
  10129. æD 
  10130. /*  messages for status functions for DBStartQuery  */
  10131.  
  10132. #define kDBUpdateWind 0
  10133. æC 
  10134.  
  10135. æKY kDBAboutToInit
  10136. æFc DatabaseAccess.h
  10137. æT #define
  10138. æD #define kDBAboutToInit 1
  10139. æC 
  10140.  
  10141. æKY kDBInitComplete
  10142. æFc DatabaseAccess.h
  10143. æT #define
  10144. æD #define kDBInitComplete 2
  10145. æC 
  10146.  
  10147. æKY kDBSendComplete
  10148. æFc DatabaseAccess.h
  10149. æT #define
  10150. æD #define kDBSendComplete 3
  10151. æC 
  10152.  
  10153. æKY kDBExecComplete
  10154. æFc DatabaseAccess.h
  10155. æT #define
  10156. æD #define kDBExecComplete 4
  10157. æC 
  10158.  
  10159. æKY kDBStartQueryComplete
  10160. æFc DatabaseAccess.h
  10161. æT #define
  10162. æD #define kDBStartQueryComplete 5
  10163. æC 
  10164.  
  10165. æKY kDBGetItemComplete
  10166. æFc DatabaseAccess.h
  10167. æT #define
  10168. æD 
  10169. /*  messages for status functions for DBGetQueryResults  */
  10170.  
  10171. #define kDBGetItemComplete 6
  10172. æC 
  10173.  
  10174. æKY kDBGetQueryResultsComplete
  10175. æFc DatabaseAccess.h
  10176. æT #define
  10177. æD #define kDBGetQueryResultsComplete 7
  10178. æC 
  10179.  
  10180. æKY typeNone
  10181. æFc DatabaseAccess.h
  10182. æT #define
  10183. æD 
  10184. /*  data type codes  */
  10185.  
  10186. #define typeNone 'none'
  10187. æC 
  10188.  
  10189. æKY typeBoolean
  10190. æFc DatabaseAccess.h
  10191. æT #define
  10192. æD #define typeBoolean 'bool'
  10193. æC 
  10194.  
  10195. æKY typeSMInt
  10196. æFc DatabaseAccess.h
  10197. æT #define
  10198. æD #define typeSMInt 'smin'
  10199. æC 
  10200.  
  10201. æKY typeInteger
  10202. æFc DatabaseAccess.h
  10203. æT #define
  10204. æD #define typeInteger 'int '
  10205. æC 
  10206.  
  10207. æKY typeSMFloat
  10208. æFc DatabaseAccess.h
  10209. æT #define
  10210. æD #define typeSMFloat 'smfl'
  10211. æC 
  10212.  
  10213. æKY typeFloat
  10214. æFc DatabaseAccess.h
  10215. æT #define
  10216. æD #define typeFloat 'flot'
  10217. æC 
  10218.  
  10219. æKY typeDate
  10220. æFc DatabaseAccess.h
  10221. æT #define
  10222. æD #define typeDate 'date'
  10223. æC 
  10224.  
  10225. æKY typeTime
  10226. æFc DatabaseAccess.h
  10227. æT #define
  10228. æD #define typeTime 'time'
  10229. æC 
  10230.  
  10231. æKY typeTimeStamp
  10232. æFc DatabaseAccess.h
  10233. æT #define
  10234. æD #define typeTimeStamp 'tims'
  10235. æC 
  10236.  
  10237. æKY typeChar
  10238. æFc DatabaseAccess.h
  10239. æT #define
  10240. æD #define typeChar 'char'
  10241. æC 
  10242.  
  10243. æKY typeDecimal
  10244. æFc DatabaseAccess.h
  10245. æT #define
  10246. æD #define typeDecimal 'decm'
  10247. æC 
  10248.  
  10249. æKY typeMoney
  10250. æFc DatabaseAccess.h
  10251. æT #define
  10252. æD #define typeMoney 'mony'
  10253. æC 
  10254.  
  10255. æKY typeVChar
  10256. æFc DatabaseAccess.h
  10257. æT #define
  10258. æD #define typeVChar 'vchr'
  10259. æC 
  10260.  
  10261. æKY typeVBin
  10262. æFc DatabaseAccess.h
  10263. æT #define
  10264. æD #define typeVBin 'vbin'
  10265. æC 
  10266.  
  10267. æKY typeLChar
  10268. æFc DatabaseAccess.h
  10269. æT #define
  10270. æD #define typeLChar 'lchr'
  10271. æC 
  10272.  
  10273. æKY typeLBin
  10274. æFc DatabaseAccess.h
  10275. æT #define
  10276. æD #define typeLBin 'lbin'
  10277. æC 
  10278.  
  10279. æKY typeDiscard
  10280. æFc DatabaseAccess.h
  10281. æT #define
  10282. æD #define typeDiscard 'disc'
  10283. æC 
  10284.  
  10285. æKY typeUnknown
  10286. æFc DatabaseAccess.h
  10287. æT #define
  10288. æD 
  10289. /*  "dummy" types for DBResultsToText  */
  10290.  
  10291. #define typeUnknown 'unkn'
  10292. æC 
  10293.  
  10294. æKY typeColBreak
  10295. æFc DatabaseAccess.h
  10296. æT #define
  10297. æD #define typeColBreak 'cbrk'
  10298. æC 
  10299.  
  10300. æKY typeRowBreak
  10301. æFc DatabaseAccess.h
  10302. æT #define
  10303. æD #define typeRowBreak 'rbrk'
  10304. æC 
  10305.  
  10306. æKY typeAnyType
  10307. æFc DatabaseAccess.h
  10308. æT #define
  10309. æD 
  10310. /*  pass this in to DBGetItem for any data type  */
  10311.  
  10312. #define typeAnyType (DBType)0
  10313. æC 
  10314.  
  10315. æKY kDBWaitForever
  10316. æFc DatabaseAccess.h
  10317. æT #define
  10318. æD 
  10319. /*  infinite timeout value for DBGetItem  */
  10320.  
  10321. #define kDBWaitForever -1
  10322. æC 
  10323.  
  10324. æKY kDBLastColFlag
  10325. æFc DatabaseAccess.h
  10326. æT #define
  10327. æD 
  10328. /*  flag for last column in row for DBGetItem  */
  10329.  
  10330. #define kDBLastColFlag 0x0001
  10331. æC 
  10332.  
  10333. æKY DBType
  10334. æFc DatabaseAccess.h
  10335. æT typedef
  10336. æD typedef OSType DBType;
  10337. æC 
  10338.  
  10339. æKY QueryListHandle
  10340. æFc DatabaseAccess.h
  10341. æT typedef
  10342. æD typedef Handle **QueryListHandle; /* just handles to 'wstr' resources */
  10343. æC 
  10344.  
  10345. æKY DBAsyncParamBlockRec
  10346. DBAsyncParmBlkPtr
  10347. æFc DatabaseAccess.h
  10348. æT struct
  10349. æD struct DBAsyncParamBlockRec {
  10350.     ProcPtr completionProc; /* pointer to completion routine */
  10351.     OSErr result; /* result of call */
  10352.     long userRef; /* for application's use */
  10353.     long ddevRef; /* for ddev's use */
  10354.     long reserved; /* for internal use */
  10355. };
  10356.  
  10357. typedef struct DBAsyncParamBlockRec DBAsyncParamBlockRec;
  10358. typedef DBAsyncParamBlockRec *DBAsyncParmBlkPtr;
  10359.  
  10360. /*  structure for resource list in QueryRecord 
  10361.  
  10362.  */
  10363. æC 
  10364.  
  10365. æKY ResListElem
  10366. ResListHandle
  10367. æFc DatabaseAccess.h
  10368. æT struct
  10369. æD struct ResListElem {
  10370.     ResType theType; /* resource type */
  10371.     short id; /* resource id */
  10372. };
  10373.  
  10374. typedef struct ResListElem ResListElem;
  10375. /*  structure for query list in QueryRecord  */
  10376. æC 
  10377.  
  10378. æKY QueryRecord
  10379. QueryPtr
  10380. QueryHandle
  10381. æFc DatabaseAccess.h
  10382. æT struct
  10383. æD struct QueryRecord {
  10384.     Short version; /* version */
  10385.     Short id; /* id of 'qrsc' this came from */
  10386.     Handle queryProc; /* handle to query def proc */
  10387.     Str63 ddevName; /* ddev name */
  10388.     Str255 host; /* host */
  10389.     Str255 user; /* user */
  10390.     Str255 password; /* password */
  10391.     Str255 connStr; /* connection string */
  10392.     Short currQuery; /* current query */
  10393.     Short numQueries; /* number of queries in queryList */
  10394.     QueryListHandle queryList; /* handle to list of queries */
  10395.     Short numRes; /* number of resources in resList */
  10396.     ResListHandle resList; /* handle to list of other resources */
  10397.     Handle dataHandle; /* data used by query def proc */
  10398.     long refCon; /* query's reference value */
  10399. };
  10400.  
  10401. typedef struct QueryRecord QueryRecord;
  10402. typedef QueryRecord *QueryPtr, **QueryHandle;
  10403.  
  10404. /*  structure of column types array in ResultsRecord  */
  10405. æC 
  10406.  
  10407. æKY DBColInfoRecord
  10408. æFc DatabaseAccess.h
  10409. æT struct
  10410. æD struct DBColInfoRecord {
  10411.     short len;
  10412.     short places;
  10413.     short flags;
  10414. };
  10415.  
  10416. typedef struct DBColInfoRecord DBColInfoRecord;
  10417. æC 
  10418.  
  10419. æKY ResultsRecord
  10420. æFc DatabaseAccess.h
  10421. æT struct
  10422. æD struct ResultsRecord {
  10423.     Short numRows; /* number of rows in result */
  10424.     Short numCols; /* number of colums per row */
  10425.     Handle colTypes; /* data type array*/
  10426.     Handle colData; /* actual results */
  10427.     Handle colInfo; /* DBColInfoRecord array */
  10428. };
  10429.  
  10430. typedef struct ResultsRecord ResultsRecord;
  10431. æC 
  10432.  
  10433. æKY InitDBPack
  10434. æFc DatabaseAccess.h
  10435. æT Function
  10436. æTN A82F
  10437. æD pascal OSErr InitDBPack(void)
  10438.     = {0x3F3C,0x0004,0x303C,0x0100,0xA82F}; 
  10439. æDT OSErr myVariable = InitDBPack()(void);
  10440. æC 
  10441. You must call the InitDBPack function before you call any other Database Access
  10442. Manager routines. You must call the QuitDBPack function when you are finished
  10443. using the Database Access Manager.
  10444.  
  10445. The InitDBPack function causes the Package Manager to load the Database Access
  10446. Manager into memory, if it has not already done so, and increments the Database
  10447. Access Manager use counter. The use counter prevents any application from
  10448. removing the Database Access Manager from memory while another application is
  10449. using it.  
  10450.  
  10451. The interface routine that implements the InitDBPack function includes a version
  10452. number for the Database Access Manager. If the package is a different version
  10453. than specified by the interface routine, then the InitDBPack function returns
  10454. the rcDBWrongVersion result code.
  10455.  
  10456. Result codes
  10457. noErr                0  No error
  10458. rcDBWrongVersion  –814  Wrong version number
  10459.  
  10460. æKY QuitDBPack
  10461. æFc DatabaseAccess.h
  10462. æT Function
  10463. æTN A82F
  10464. æD pascal OSErr QuitDBPack(void)
  10465.     = {0x303C,0x0001,0xA82F}; 
  10466. æDT OSErr myVariable = QuitDBPack()(void);
  10467. æC 
  10468. The QuitDBPack function decrements the Database Access Manager use counter. When
  10469. this counter equals 0, the QuitDBPack function removes the Database Access
  10470. Manager package from memory. Call this routine when your application is
  10471. terminating or when you are finished using the Database Access Manager. The use
  10472. counter prevents the QuitDBPack function from removing the Database Access
  10473. Manager from memory while any application is still using it.
  10474.  
  10475. Result codes
  10476. noErr                 0  No error
  10477. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10478.  
  10479. æKY DBInit
  10480. æFc DatabaseAccess.h
  10481. æT Function
  10482. æTN A82F
  10483. æD pascal OSErr DBInit(long *sessID,const Str63 ddevName,const Str255 host,
  10484.     const Str255 user,const Str255 passwd,const Str255 connStr,DBAsyncParmBlkPtr asyncPB)
  10485.     = {0x303C,0x0E02,0xA82F}; 
  10486. æDT OSErr myVariable = DBInit((long *) sessID,(const Str63) ddevName,(const Str255) host,(
  10487.     const) Str255 user,(const Str255) passwd,(const Str255) connStr,(DBAsyncParmBlkPtr) asyncPB);
  10488. æC 
  10489. The DBInit function initiates a session with a remote database server. You must
  10490. initiate a session before you call any Database Access Manager function that
  10491. requires a session ID as an input parameter. If the DBInit function returns a
  10492. nonzero session ID, you must call the DBEnd function to terminate the session,
  10493. even if the DBInit function also returns a result code other than noErr.
  10494.  
  10495. Because the high-level function DBStartQuery can call the DBInit function, if
  10496. you have called the DBStartQuery function, you do not have to call the DBInit
  10497. function. 
  10498.  
  10499. The DBInit function returns the session ID in the sessID parameter. This session
  10500. ID is unique; no other current session, for any database extension, has the same
  10501. session ID. You must specify the session ID any time you want to send data to or
  10502. retrieve data from this session. Depending on the database extension you are
  10503. using, the DBInit function might return a session ID of 0 if it fails to
  10504. initiate a session, or it might return a nonzero session ID and a result code
  10505. other than noErr. In the latter case, you can pass the session ID to the
  10506. DBGetErr function to determine the cause of the error.
  10507.  
  10508. The ddevName parameter is a string of no more than 63 characters that specifies
  10509. the name of the database extension. The name of the database extension is
  10510. contained in the database extension file in a resource of type 'STR ' with an ID
  10511. of 128. For the CL/1 database extension provided by Apple , for example, this
  10512. string is “CL/1”.
  10513.  
  10514. The host parameter specifies the name of the remote system on which the database
  10515. server is located. This name depends on the manner in which the database
  10516. extension establishes communication with the remote database server and on how
  10517. the system administrator has set up the computer system.
  10518.  
  10519. The user parameter specifies the name of the user, and the password parameter
  10520. specifies the password associated with the user name.
  10521.  
  10522. The connStr parameter is a connection string that is passed to the database
  10523. server, which might pass it on to the database management software on the remote
  10524. computer. This string is necessary in some systems to complete log-on
  10525. procedures. 
  10526. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10527. do not want to call the function asynchronously, set this parameter to NIL.
  10528.  
  10529. Result codes
  10530. noErr                 0  No error
  10531. rcDBError          –802  Error initiating session
  10532. rcDBBadDDev        –809  Couldn’t find specified database extension or 
  10533.                          trouble opening ddev file
  10534. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10535.                          database extension
  10536. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10537.  
  10538. æKY DBEnd
  10539. æFc DatabaseAccess.h
  10540. æT Function
  10541. æTN A82F
  10542. æD pascal OSErr DBEnd(long sessID,DBAsyncParmBlkPtr asyncPB)
  10543.     = {0x303C,0x0403,0xA82F}; 
  10544. æDT OSErr myVariable = DBEnd((long) sessID,(DBAsyncParmBlkPtr) asyncPB);
  10545. æC 
  10546. The DBEnd function terminates a session with a remote database server and
  10547. terminates the network connection between the application and the remote
  10548. computer. You must call the DBEnd function to terminate a session.
  10549.  
  10550. The sessID parameter is the session ID that was returned by the DBInit function.
  10551.  
  10552. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10553. do not want to call the function asynchronously, set this parameter to NIL.
  10554.  
  10555. Result codes
  10556. noErr                 0  No error
  10557. rcDBError          –802  Error ending session
  10558. rcDBBadSessID      –807  Session ID is invalid
  10559. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10560.                          database extension
  10561. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10562.  
  10563. æKY DBGetConnInfo
  10564. æFc DatabaseAccess.h
  10565. æT Function
  10566. æTN A82F
  10567. æD pascal OSErr DBGetConnInfo(long sessID,Short sessNum,long *returnID,long *version,
  10568.     const Str63 ddevName,const Str255 host,const Str255 user,const Str255 network,
  10569.     const Str255 connStr,long *start,OSErr *state,DBAsyncParmBlkPtr asyncPB)
  10570.     = {0x303C,0x1704,0xA82F}; 
  10571. æDT OSErr myVariable = DBGetConnInfo((long) sessID,(Short) sessNum,(long *) returnID,(long *) version,(
  10572.     const) Str63 ddevName,(const Str255) host,(const Str255) user,(const Str255) network,(
  10573.     const) Str255 connStr,(long *) start,(OSErr *) state,(DBAsyncParmBlkPtr) asyncPB);
  10574. æC 
  10575. The DBGetConnInfo function returns information about the specified session,
  10576. including 
  10577.  
  10578.   •   the version of the database extension
  10579.   •   the name of the remote system on which the session is running
  10580.   •   the user name
  10581.   •   the connection string that was used to establish communication
  10582.   •   the name of the network
  10583.   •   the time at which the session started, in ticks
  10584.   •   the status of the session
  10585.  
  10586. In addition, if you include a nonzero value for the sessID parameter when you
  10587. call the DBGetConnInfo function, the function returns the name of the database
  10588. extension. If you use 0 for the sessID parameter and specify the database
  10589. extension and session number instead, the function returns the session ID.
  10590.  
  10591. You can use this function to get information about a particular session, or you
  10592. can call the function repeatedly, incrementing the session number each time, to
  10593. get information about all of the sessions associated with a particular database
  10594. extension.
  10595.  
  10596. The sessID parameter is the session ID that was returned by the DBInit function.
  10597. The sessNum parameter is the session number of the session about which you want
  10598. information. You can specify either the session ID or the session number when
  10599. you call the DBInit function. If you specify the sessID parameter, use 0 for the
  10600. sessNum parameter. If you specify the sessNum parameter, then use 0 for the
  10601. sessID parameter. If you specify the sessNum parameter, you must specify a value
  10602. for the ddevName parameter as well. If you specify the session number and the
  10603. database extension, then the DBGetConnInfo function returns the session ID in
  10604. the returnedID parameter. 
  10605.  
  10606. The version parameter returns the version number of the database extension that
  10607. is the interface to the remote database server on which this session is running.
  10608.  
  10609. The ddevName parameter specifies the name of the database extension. If you
  10610. specify 0 for the session ID, you must include the name of the database
  10611. extension as well as a session number. If you specify a valid session ID, then
  10612. the DBGetConnInfo function returns the name of the database extension in the
  10613. ddevName parameter. The name of the database extension is included in a 'STR '
  10614. resource in the database extension file with a resource ID of 128.
  10615.  
  10616. The host, user, and connStr parameters are the host, user, and connection
  10617. strings that were used to establish communication with the remote database
  10618. server. The network parameter is the name of the network through which your
  10619. computer is communicating with the remote database server.
  10620.  
  10621. The start parameter is the time, in ticks, at which this session was initiated.
  10622.  
  10623. The state parameter returns one of the following values to provide information
  10624. about the status of the session:
  10625.  
  10626. CONST
  10627. noErr      =    0  ;No error; ready for more text
  10628. rcDBValue  = –801  ;Output data available
  10629. rcDBError  = –802  ;Execution ended in an error
  10630. rcDBExec   = –806  ;Busy; currently executing query
  10631.  
  10632. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10633. do not want to call the function asynchronously, set this parameter to NIL.
  10634.  
  10635. Result codes
  10636. noErr                 0  No error
  10637. rcDBBadSessNum     –808  Invalid session number
  10638. rcDBBadSessID      –807  Session ID is invalid or database extension name is 
  10639.                          invalid
  10640. rcDBBadDDev        –809  Couldn’t find specified database extension or 
  10641.                          trouble opening ddev file
  10642. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10643.                          database extension
  10644. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10645.  
  10646. æKY DBGetSessionNum
  10647. æFc DatabaseAccess.h
  10648. æT Function
  10649. æTN A82F
  10650. æD pascal OSErr DBGetSessionNum(long sessID,Short *sessNum,DBAsyncParmBlkPtr asyncPB)
  10651.     = {0x303C,0x0605,0xA82F}; 
  10652. æDT OSErr myVariable = DBGetSessionNum((long) sessID,(Short *) sessNum,(DBAsyncParmBlkPtr) asyncPB);
  10653. æC 
  10654. The DBGetSessionNum function returns the session number of the session you
  10655. specify with the session ID parameter. The session number is unique for a
  10656. particular database extension, but the same session number might be in use for
  10657. different database extensions at the same time.
  10658.  
  10659. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10660. do not want to call the function asynchronously, set this parameter to NIL.
  10661.  
  10662. Result codes
  10663. noErr                 0  No error
  10664. rcDBBadSessID      –807  Session ID is invalid
  10665. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10666.                          database extension
  10667. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10668.  
  10669. æKY DBSend
  10670. æFc DatabaseAccess.h
  10671. æT Function
  10672. æTN A82F
  10673. æD pascal OSErr DBSend(long sessID,char *text,Short len,DBAsyncParmBlkPtr asyncPB)
  10674.     = {0x303C,0x0706,0xA82F}; 
  10675. æDT OSErr myVariable = DBSend((long) sessID,(char *) text,(Short) len,(DBAsyncParmBlkPtr) asyncPB);
  10676. æC 
  10677. The DBSend function sends a query or a portion of a query to the remote database
  10678. server. The database server appends this portion of the query to any portion you
  10679. sent previously. Because the Database Access Manager and database server do not
  10680. modify the string you send in any way, they do not insert any delimiter between
  10681. fragments of queries that you send to the database server. If you want a blank
  10682. or a semicolon to be included between query fragments, or if you want to use
  10683. return characters to divide the query into lines of text, you must include them
  10684. in the character string that you send with this function. 
  10685.  
  10686. The database server does not execute the query until you call the DBExec
  10687. function.
  10688.  
  10689. The sessID parameter is the session ID that was returned by the DBInit function.
  10690.  
  10691. The text parameter is a pointer to the query or query fragment that you want to
  10692. send to the database server. The query or query fragment must be a character
  10693. string. The len parameter specifies the length of the character string. If the
  10694. len parameter has a value of –1, then the character string is assumed to be 
  10695. “NULL terminated” (that is, the string ends with a NULL byte); otherwise, the
  10696. len parameter specifies the number of bytes in the string.
  10697.  
  10698. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10699. do not want to call the function asynchronously, set this parameter to NIL.
  10700.  
  10701. Result codes
  10702. noErr                 0  No error
  10703. rcDBError          –802  Error trying to send text
  10704. rcDBBadSessID      –807  Session ID is invalid
  10705. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10706.                          database extension
  10707. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10708.  
  10709. æKY DBSendItem
  10710. æFc DatabaseAccess.h
  10711. æT Function
  10712. æTN A82F
  10713. æD pascal OSErr DBSendItem(long sessID,char dataType,Short len,Short places,
  10714.     Short flags,Ptr buffer,DBAsyncParmBlkPtr asyncPB)
  10715.     = {0x303C,0x0B07,0xA82F}; 
  10716. æDT OSErr myVariable = DBSendItem((long) sessID,(char) dataType,(Short) len,(Short) places,()
  10717.     Short flags,(Ptr) buffer,(DBAsyncParmBlkPtr) asyncPB);
  10718. æC 
  10719. The DBSendItem function sends a single data item to the remote database server.
  10720. You can use this function to send to the database server the data that you wish
  10721. to include in a query. The database extension or the database server (depending
  10722. on how the system is implemented) converts the data item to a character string
  10723. and appends it to the query, just as a query program fragment is appended to the
  10724. query by the DBSend function. The query is not executed until you call the
  10725. DBExec function.
  10726.  
  10727. The sessID parameter is the session ID that was returned by the DBInit function.
  10728.  
  10729. The dataType, len, and places parameters specify the data type, length, and
  10730. number of decimal places for the data item that you are sending to the remote
  10731. database server. The database extension and database server ignore the len
  10732. parameter if the data type has an implied length. The database extension and
  10733. database server ignore the places parameter for all values of the dataType
  10734. parameter except typeDecimal and typeMoney. Data types are discussed in “Getting
  10735. Query Results” earlier in this chapter.
  10736.  
  10737. The buffer parameter is a pointer to the memory location of the data item that
  10738. you want to send. When you use the DBSendItem function to send an item of data
  10739. to a database server, the database extension and database server format the data
  10740. according to the data type, length, and decimal places you specified, converts
  10741. it to a character string, and appends the data to the query. 
  10742.  
  10743. Set the flags parameter to 0. There are no flags currently defined for the
  10744. DBSendItem function. 
  10745.  
  10746. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10747. do not want to call the function asynchronously, set this parameter to NIL.
  10748.  
  10749. Result codes
  10750. noErr                 0  No error
  10751. rcDBError          –802  Error trying to send item
  10752. rcDBBadSessID      –807  Session ID is invalid
  10753. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10754.                          database extension
  10755. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10756.  
  10757. æKY DBExec
  10758. æFc DatabaseAccess.h
  10759. æT Function
  10760. æTN A82F
  10761. æD pascal OSErr DBExec(long sessID,DBAsyncParmBlkPtr asyncPB)
  10762.     = {0x303C,0x0408,0xA82F}; 
  10763. æDT OSErr myVariable = DBExec((long) sessID,(DBAsyncParmBlkPtr) asyncPB);
  10764. æC 
  10765. The DBExec function initiates execution of a query that you have sent to the
  10766. remote database server. Use the DBSend and DBSendItem functions to send a query
  10767. to the database server. Use the DBState function to determine the status of a
  10768. query after you have initiated execution.
  10769.  
  10770. The sessID parameter is the session ID that was returned by the DBInit function.
  10771.  
  10772. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10773. do not want to call the function asynchronously, set this parameter to NIL.
  10774.  
  10775. Result codes
  10776. noErr                 0  Execution has begun
  10777. rcDBError          –802  Error trying to begin execution
  10778. rcDBBadSessID      –807  Session ID is invalid
  10779. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10780.                          database extension
  10781. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10782.  
  10783. æKY DBState
  10784. æFc DatabaseAccess.h
  10785. æT Function
  10786. æTN A82F
  10787. æD pascal OSErr DBState(long sessID,DBAsyncParmBlkPtr asyncPB)
  10788.     = {0x303C,0x0409,0xA82F}; 
  10789. æDT OSErr myVariable = DBState((long) sessID,(DBAsyncParmBlkPtr) asyncPB);
  10790. æC 
  10791. The result code returned by the DBState function indicates the status of the
  10792. remote database server. You can use this function to determine whether the
  10793. database server has successfully executed a query and whether it has data
  10794. available for you to retrieve. 
  10795.  
  10796. The sessID parameter is the session ID that was returned by the DBInit function.
  10797.  
  10798. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10799. do not want to call the function asynchronously, set this parameter to NIL.
  10800.  
  10801. Result codes
  10802. noErr                 0  No error; ready for more text
  10803. rcDBValue          –801  Output data available
  10804. rcDBError          –802  Execution ended in an error
  10805. rcDBExec           –806  Currently executing query
  10806. rcDBBadSessID      –807  Session ID is invalid
  10807. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by
  10808.                          database extension
  10809. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10810.  
  10811. æKY DBGetErr
  10812. æFc DatabaseAccess.h
  10813. æT Function
  10814. æTN A82F
  10815. æD pascal OSErr DBGetErr(long sessID,long *err1,long *err2,const Str255 item1,
  10816.     const Str255 item2,const Str255 errorMsg,DBAsyncParmBlkPtr asyncPB)
  10817.     = {0x303C,0x0E0A,0xA82F}; 
  10818. æDT OSErr myVariable = DBGetErr((long) sessID,(long *) err1,(long *) err2,(const Str255) item1,(
  10819.     const) Str255 item2,(const Str255) errorMsg,(DBAsyncParmBlkPtr) asyncPB);
  10820. æC 
  10821. The DBGetErr function retrieves error codes and error messages from a remote
  10822. database server. You can use this function to obtain information when a
  10823. low-level function returns the result code rcDBError. If the DBState function
  10824. returns the rcDBError result code, indicating that execution of a query ended in
  10825. an error, the error information can help you debug the query. The meaning of
  10826. each error code and error message returned by this function depends on the
  10827. database server with which you are communicating; see the documentation for that
  10828. database server for more information.
  10829.  
  10830. The sessID parameter is the session ID that was returned by the DBInit function.
  10831.  
  10832. The err1 and err2 parameters return the primary and secondary error codes. The
  10833. item1 and item2 parameters return strings that describe the objects of the error
  10834. message. The errorMsg parameter returns the error message.
  10835.  
  10836. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10837. do not want to call the function asynchronously, set this parameter to NIL.
  10838.  
  10839. Result codes
  10840. noErr                 0  No error
  10841. rcDBError          –802  Error retrieving error information
  10842. rcDBBadSessID      –807  Session ID is invalid
  10843. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by
  10844.                          database extension
  10845. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10846.  
  10847. æKY DBBreak
  10848. æFc DatabaseAccess.h
  10849. æT Function
  10850. æTN A82F
  10851. æD pascal OSErr DBBreak(long sessID,Boolean abort,DBAsyncParmBlkPtr asyncPB)
  10852.     = {0x303C,0x050B,0xA82F}; 
  10853. æDT OSErr myVariable = DBBreak((long) sessID,(Boolean) abort,(DBAsyncParmBlkPtr) asyncPB);
  10854. æC 
  10855. The DBBreak function can halt execution of a query and reinitialize the remote
  10856. database server, or it can unconditionally terminate a session with a database
  10857. server. You can use this function to cancel a query if you determine that it is
  10858. taking too long to complete execution, for example.
  10859.  
  10860. The sessID parameter is the session ID that was returned by the DBInit function.
  10861.  
  10862. If the abort parameter is TRUE (nonzero), the database server halts any query
  10863. that is executing and terminates the current session. If the abort parameter is
  10864. FALSE (0), the database server halts any query that is executing and
  10865. reinitializes itself.
  10866.  
  10867. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10868. do not want to call the function asynchronously, set this parameter to NIL.
  10869.  
  10870. Result codes
  10871. noErr                 0  Execution has begun
  10872. rcDBError          –802  Break or abort attempt was unsuccessful
  10873. rcDBBadSessID      –807  Session ID is invalid
  10874. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10875.                          database extension
  10876. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10877.  
  10878. æKY DBGetItem
  10879. æFc DatabaseAccess.h
  10880. æT Function
  10881. æTN A82F
  10882. æD pascal OSErr DBGetItem(long sessID,long timeout,char *dataType,sort *len,
  10883.     Short *places,Short *flags,Ptr buffer,DBAsyncParmBlkPtr asyncPB)
  10884.     = {0x303C,0x100C,0xA82F}; 
  10885. æDT OSErr myVariable = DBGetItem((long) sessID,(long) timeout,(char *) dataType,(sort *) len,(
  10886.     Short) * places,(Short *) flags,(Ptr) buffer,(DBAsyncParmBlkPtr) asyncPB);
  10887. æC 
  10888. The DBGetItem function retrieves the next data item from the database server.
  10889. You can also use this function to obtain information about the next data item
  10890. without retrieving the data. You can use the DBGetItem function after you have
  10891. executed a query and the DBState function has returned the result code
  10892. rcDBValue, indicating that data is available. You can repeat the DBGetItem
  10893. function as many times as is necessary to retrieve all of the data returned by
  10894. the database in response to a query.
  10895.  
  10896. The sessID parameter is the session ID that was returned by the DBInit function.
  10897.  
  10898. You can use the timeout parameter to specify the maximum amount of time that the
  10899. database extension should wait to receive results from the database server
  10900. before canceling the function. Specify the timeout parameter in sixtieths of a
  10901. second. To disable the timeout feature, set the timeout parameter to the value
  10902. kDBWaitForever. If the timeout period expires, the DBGetItem function returns
  10903. the result code rcDBBreak. The DBGetItem function ignores the timeout parameter
  10904. if you call the function asynchronously. 
  10905.  
  10906. One use for the timeout parameter is to call the DBGetItem function periodically
  10907. with a short value set for this parameter in order to return control to your
  10908. application while a query is executing. Your application can then retrieve the
  10909. next data item as soon as execution of the query is complete without having to
  10910. call the DBState function to determine when data is available.
  10911.  
  10912. You can set the dataType parameter to specify the data type that you expect the
  10913. next data item to be. If the item is not of the expected data type, the database
  10914. extension returns the rcDBBadType result code. If you want to retrieve the next
  10915. data item regardless of type, set the dataType parameter to the value
  10916. typeAnyType. To skip the next data item, set the dataType parameter to the value
  10917. typeDiscard. The database server sets the dataType parameter to the actual type
  10918. of the data item when it retrieves the data item or returns information about
  10919. the data item. Data types are discussed in “Getting Query Results” earlier in
  10920. this chapter.
  10921.  
  10922. Set the len parameter to the length of the data buffer pointed to by the buffer
  10923. parameter. If you use the DBGetItem function to obtain information only (by
  10924. setting the buffer parameter to NIL), then the database server ignores the len
  10925. parameter. The database server sets the len parameter to the actual length of
  10926. the data item when it retrieves the data item or returns information about the
  10927. data item.
  10928.  
  10929. The database server returns in the places parameter the number of decimal places
  10930. in data items of types typeMoney and typeDecimal. For all other data types, the
  10931. database server returns 0 for the places parameter.
  10932.  
  10933. The buffer parameter is a pointer to the location where you want the retrieved
  10934. data item to be stored. You must ensure that the location you specify contains
  10935. enough space for the data item that will be returned. To determine the data
  10936. type, length, and number of decimal places of the next data item without
  10937. retrieving it, specify NIL for the buffer parameter. 
  10938.  
  10939. If the flags parameter is set to kDBLastColFlag (that is, the least significant
  10940. bit is set to 1), the data item is in the last column of the row. 
  10941. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10942. do not want to call the function asynchronously, set this parameter to NIL.
  10943.  
  10944. Result codes
  10945. noErr                 0  No error; no next data item
  10946. rcDBNull           –800  The data item was NULL
  10947. rcDBValue          –801  A nonzero data item was successfully retrieved
  10948. rcDBError          –802  Execution ended in an error
  10949. rcDBBadType        –803  Next data item not of requested data type
  10950. rcDBBreak          –805  Timed out
  10951. rcDBBadSessID      –807  Session ID is invalid
  10952. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10953.                          database extension
  10954. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10955.  
  10956. æKY DBUnGetItem
  10957. æFc DatabaseAccess.h
  10958. æT Function
  10959. æTN A82F
  10960. æD pascal OSErr DBUnGetItem(long sessID,DBAsyncParmBlkPtr asyncPB)
  10961.     = {0x303C,0x040D,0xA82F}; 
  10962. æDT OSErr myVariable = DBUnGetItem((long) sessID,(DBAsyncParmBlkPtr) asyncPB);
  10963. æC 
  10964. The DBUnGetItem function reverses the effect of the last call to the DBGetItem
  10965. function, in the sense that the next time you call the DBGetItem function it
  10966. retrieves the same item a second time. It does not remove the just-retrieved
  10967. data item from the input buffer. The DBUnGetItem function can reverse the effect
  10968. of only one call to the DBGetItem function; you cannot use it to step back
  10969. through several previously retrieved data items. 
  10970.  
  10971. The sessID parameter is the session ID that was returned by the DBInit function.
  10972.  
  10973. The asyncPB parameter is a pointer to the asynchronous parameter block. If you
  10974. do not want to call the function asynchronously, set this parameter to NIL.
  10975.  
  10976. Result codes
  10977. noErr                 0  No error
  10978. rcDBError          –802  Error executing function
  10979. rcDBBadSessID      –807  Session ID is invalid
  10980. rcDBAsyncNotSupp   –811  Asynchronous calls are not supported by 
  10981.                          database extension
  10982. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  10983.  
  10984. æKY DBKill
  10985. æFc DatabaseAccess.h
  10986. æT Function
  10987. æTN A82F
  10988. æD pascal OSErr DBKill(DBAsyncParmBlkPtr asyncPB)
  10989.     = {0x303C,0x020E,0xA82F}; 
  10990. æDT OSErr myVariable = DBKill((DBAsyncParmBlkPtr) asyncPB);
  10991. æC 
  10992. The DBKill function cancels the execution of the asynchronous call specified by
  10993. the asyncPB parameter.
  10994.  
  10995. The asyncPB parameter is a pointer to the asynchronous parameter block.
  10996.  
  10997. Result codes
  10998. noErr                 0  Asynchronous routine canceled successfully
  10999. rcDBError          –802  Error canceling routine
  11000. rcDBBadAsynchPB    –812  Invalid parameter block specified
  11001. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11002.  
  11003. æKY DBGetNewQuery
  11004. æFc DatabaseAccess.h
  11005. æT Function
  11006. æTN A82F
  11007. æD pascal OSErr DBGetNewQuery(Short queryID,QueryHandle *qeury)
  11008.     = {0x303C,0x030F,0xA82F}; 
  11009. æDT OSErr myVariable = DBGetNewQuery((Short) queryID,(QueryHandle *) qeury);
  11010. æC 
  11011. The DBGetNewQuery function creates a query record from the 'qrsc' resource with
  11012. the resource ID you specify in the queryID parameter. The resource file that
  11013. contains the 'qrsc' resource must remain open until after the DBStartQuery
  11014. function has completed execution. If you do not already know the resource ID of
  11015. the 'qrsc' resource (for example, if you call the SFGetFile procedure to let the
  11016. user select the query document), you can use Resource Manager routines to
  11017. determine the resource ID. The SFGetFile procedure is described in the Standard
  11018. File Package chapter of Volume I and the Resource Manager is described in Volume
  11019. Chapter 5.
  11020.  
  11021. The queryID parameter specifies the resource ID of the 'qrsc' resource that you
  11022. want to use. The query parameter returns a handle to the query record.
  11023.  
  11024. Result code
  11025. noErr                 0  Query record built successfully
  11026. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11027.  
  11028. æKY DBDisposeQuery
  11029. æFc DatabaseAccess.h
  11030. æT Function
  11031. æTN A82F
  11032. æD 
  11033. pascal OSErr DBDisposeQuery(QueryHandle query)
  11034.     = {0x303C,0x0210,0xA82F}; 
  11035. æDT OSErr myVariable = DBDisposeQuery((QueryHandle) query);
  11036. æC 
  11037. The DBDisposeQuery function disposes of a query record and frees all the memory
  11038. that the Database Access Manager allocated when it created the query record. You
  11039. should call this function after you are finished using a query record.
  11040.  
  11041. The query parameter is a handle to the query record.
  11042.  
  11043. Result code
  11044. noErr                 0  Query record disposed of successfully
  11045. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11046.  
  11047. æKY DBStartQuery
  11048. æFc DatabaseAccess.h
  11049. æT Function
  11050. æTN A82F
  11051. æD pascal OSErr DBStartQuery(long *sessID,QueryHandle query,ProcPtr statusProc,
  11052.     DBAsyncParmBlkPtr asyncPB)
  11053.     = {0x303C,0x0811,0xA82F}; 
  11054. æDT OSErr myVariable = DBStartQuery((long *) sessID,(QueryHandle) query,(ProcPtr) statusProc,()
  11055.     DBAsyncParmBlkPtr asyncPB);
  11056. æC 
  11057. The DBStartQuery function performs the following tasks, in the order specified:
  11058.  
  11059. 1.  It calls the query definition function (if any) pointed to by the query
  11060. record. The query definition function modifies the query record and the query,
  11061. usually by asking the user for input. The query definition function can display
  11062. a dialog box that gives the user the option of canceling the query; if the user
  11063. does cancel the query, the DBStartQuery function returns the userCanceledErr
  11064. result code.
  11065.  
  11066. 2.  If you specify a nonzero value for the statusProc parameter, the
  11067. DBStartQuery function calls your status routine with the value kDBUpdateWind in
  11068. the message parameter so that your application can update its windows.
  11069.  
  11070. 3.  If you specify a nonzero value for the statusProc parameter, the
  11071. DBStartQuery function calls your status routine with the value kDBAboutToInit in
  11072. the message parameter so that your application can display a dialog box
  11073. informing the user that a database session is about to be established, and
  11074. giving the user the option of canceling execution of the function.
  11075.  
  11076. 4.  If the sessID parameter is 0, the DBStartQuery function calls the DBInit
  11077. function to establish a database session, and returns a session ID. 
  11078.  
  11079. 5.  If you specify a nonzero value for the statusProc parameter and the
  11080. DBStartQuery function called the DBInit function, the DBStartQuery function
  11081. calls your status routine with the value kDBInitComplete in the message
  11082. parameter and the result of the DBInit function in the result parameter.
  11083.  
  11084. 6.  The DBStartQuery function calls the DBSend function to send the query to the
  11085. remote database server.
  11086.  
  11087. 7.  If you specify a nonzero value for the statusProc parameter, the
  11088. DBStartQuery function calls your status routine with the value kDBSendComplete
  11089. in the message parameter and the result of the DBSend function in the result
  11090. parameter.
  11091.  
  11092. 8.  The DBStartQuery function calls the DBExec function to execute the query.
  11093.  
  11094. 9.  If you specify a nonzero value for the statusProc parameter, the
  11095. DBStartQuery function calls your status routine with the value kDBExecComplete
  11096. in the message parameter and the result of the DBExec function in the result
  11097. parameter.
  11098.  
  11099. 10.  If you specify a nonzero value for the statusProc parameter, the
  11100. DBStartQuery function calls your status routine with the value
  11101. kDBStartQueryComplete in the message parameter and the result of the
  11102. DBStartQuery function in the result parameter.
  11103.  
  11104. You can use the sessID parameter to specify a session ID if your application or
  11105. another application has already established a session with the database server.
  11106. If you specify NIL for this parameter, then the DBStartQuery function
  11107. establishes a session and returns the session ID in the sessID parameter.
  11108.  
  11109. You use the query parameter to specify a handle to a query record. 
  11110. You can use the statusProc pointer to specify a pointer to a status routine that
  11111. your application can use to update its windows after the query definition
  11112. function has completed execution. If you specify NIL for this parameter, the
  11113. DBStartQuery function does not attempt to update your application’s windows. The
  11114. DBStartQuery function also calls your status routine before it initiates a
  11115. database session, after it calls the DBInit function, after it calls the DBSend
  11116. function, and after it calls the DBExec function. Status routines are discussed
  11117. in “Writing a Status Routine for High-Level Functions” earlier in this chapter.
  11118.  
  11119. If you specify a pointer to an asynchronous parameter block in the asyncPB
  11120. parameter, the DBStartQuery function calls the DBInit, DBSend, and DBExec
  11121. functions asynchronously. As soon as the DBInit function has started execution,
  11122. it returns control to your application. Your application must then call the
  11123. WaitNextEvent routine periodically to allow these asynchronous routines to run,
  11124. and it must check the result field of the asynchronous parameter block to
  11125. determine when each routine has completed execution.
  11126.  
  11127. Result codes
  11128. noErr                 0  No error
  11129. userCanceledErr    –128  User canceled the query 
  11130. rcDBError          –802  Error initiating session, sending text, or executing 
  11131.                          query
  11132. rcDBBadDDev        –809  Couldn’t find the specified database extension, or
  11133.                          error occurred in opening database extension   
  11134. rcDBAsyncNotSupp   –811  The database extension does not support asynchronous
  11135.                          calls
  11136. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11137.  
  11138. æKY DBGetQueryResults
  11139. æFc DatabaseAccess.h
  11140. æT Function
  11141. æTN A82F
  11142. æD pascal OSErr DBGetQueryResults(long sessID,ResultsRecord *results,long timeout,
  11143.     ProcPtr statusProc,DBAsyncParmBlkPtr asyncPB)
  11144.     = {0x303C,0x0A12,0xA82F}; 
  11145. æDT OSErr myVariable = DBGetQueryResults((long) sessID,(ResultsRecord *) results,(long) timeout,()
  11146.     ProcPtr statusProc,(DBAsyncParmBlkPtr) asyncPB);
  11147. æC 
  11148. The DBGetQueryResults function retrieves the results returned by a query and
  11149. places them in memory. If there is sufficient memory available, this function
  11150. retrieves all of the results at once. If the DBGetQueryResults function runs out
  11151. of memory, it places as much data as possible in memory, up to the last whole
  11152. row. You can then make more memory available and call the DBGetQueryResults
  11153. function again to retrieve more data. 
  11154.  
  11155. The DBGetQueryResults function can be used to retrieve the results of any query,
  11156. not only queries sent and executed by the DBStartQuery function.
  11157.  
  11158. The sessID parameter specifies the ID of the session from which you wish to
  11159. retrieve results. 
  11160. The results parameter is the results record, which contains a handle to the
  11161. retrieved data. Results records are described in “Getting Query Results” earlier
  11162. in this chapter.
  11163.  
  11164. The timeout parameter specifies the value that he DBGetQueryResults uses for the
  11165. timeout parameter each time it calls the DBGetItem function. The timeout
  11166. parameter specifies the maximum amount of time that the database extension
  11167. should wait to receive results from the database server before canceling the
  11168. DBGetItem function. Specify the timeout parameter in sixtieths of a second. To
  11169. disable the timeout feature, set the timeout parameter to the value
  11170. kDBWaitForever. This parameter is ignored if you specify a nonzero value for the
  11171. asyncPB parameter.
  11172.  
  11173. You can use the statusProc pointer to specify a pointer to a status routine that
  11174. you provide. The DBGetQueryResults function calls your status routine after it
  11175. calls the DBGetItem function to retrieve a data item. When it calls the status
  11176. routine, the DBGetQueryResults function provides the results of the DBGetItem
  11177. function, the data type, the data length, number of decimal places, and flags
  11178. associated with the data item, and a pointer to the data item. Status routines
  11179. are discussed in “Writing a Status Routine For High-Level Functions” earlier in
  11180. this chapter.
  11181.  
  11182. If you specify a pointer to an asynchronous parameter block in the asyncPB
  11183. parameter, the DBGetQueryResults function calls the DBGetItem function
  11184. asynchronously for each data item. As soon as the DBGetItem function has started
  11185. execution, it returns control to your application. Your application must then
  11186. call the WaitNextEvent routine periodically to allow this asynchronous routine
  11187. to run, and it must check the result field of the asynchronous parameter block
  11188. to determine when the routine has completed execution.
  11189.  
  11190. Result codes
  11191. noErr                 0  Query execution successful; no results returned
  11192. userCanceledErr    –128  Function canceled by status routine
  11193. rcDBValue          –801  Data available 
  11194. rcDBError          –802  Query execution ended in an error
  11195. rcDBBreak          –805  Function timed out
  11196. rcDBExec           –806  Query currently executing 
  11197. rcDBBadSessID      –807  Session ID is invalid
  11198. rcDBAsyncNotSupp   –811  The database extension does not support 
  11199.                          asynchronous calls
  11200. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11201.  
  11202. æKY DBResultsToText
  11203. æFc DatabaseAccess.h
  11204. æT Function
  11205. æTN A82F
  11206. æD pascal OSErr DBResultsToText(ResultsRecord *results,Handle *theText)
  11207.     = {0x303C,0x0413,0xA82F}; 
  11208. æDT OSErr myVariable = DBResultsToText((ResultsRecord *) results,(Handle *) theText);
  11209. æC 
  11210. The DBResultsToText function calls result handlers to convert to text the data
  11211. retrieved by the DBGetQueryResults function. Result handlers are described in 
  11212. “Converting Query Results to Text” earlier in this chapter.
  11213.  
  11214. The results parameter is the results record returned by the DBGetQueryResults
  11215. function. The parameter theText contains a handle to the converted text. This
  11216. handle is allocated by the Database Access Manager.
  11217.  
  11218. Result code
  11219. noErr                 0  No error
  11220. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11221.  
  11222. æKY DBInstallResultHandler
  11223. æFc DatabaseAccess.h
  11224. æT Function
  11225. æTN A82F
  11226. æD pascal OSErr DBInstallResultHandler(char dataType,ProcPtr theHandler,Boolean isSysHandler)
  11227.     = {0x303C,0x0514,0xA82F}; 
  11228. æDT OSErr myVariable = DBInstallResultHandler((char) dataType,(ProcPtr) theHandler,(Boolean) isSysHandler);
  11229. æC 
  11230. The DBInstallResultHandler function installs a result handler for the data type
  11231. specified by the dataType parameter. The result handler is then used by the
  11232. DBResultsToText function to convert data of the specified type into a character
  11233. string.
  11234.  
  11235. The parameter theHandler is a pointer to the result handler. The isSysHandler
  11236. parameter specifies whether the result handler is an application result
  11237. handler—to be used only when the DBResultsToText function is called by the
  11238. application that installed the result handler—or  a system result handler—to be
  11239. used by every application running on the system.
  11240.  
  11241. When you install an application result handler, it replaces any result handler
  11242. with the same name previously installed by that application. Similarly, when you
  11243. install a system result handler, it replaces any existing system result handler
  11244. with the same name. Before you temporarily replace an existing result handler,
  11245. use the DBGetResultHandler function to obtain a pointer to the present handler,
  11246. and save the present result handler in your application’s private storage. Then
  11247. you can reinstall the original result handler when you are finished using the
  11248. temporary one.
  11249.  
  11250. Because an application result handler is used in preference to a system result
  11251. handler if both are available, you can temporarily replace a system result
  11252. handler for purposes of your application by installing an application result
  11253. handler for the same data type. You can then use the DBRemoveResultHandler
  11254. function to remove the application result handler and return to using the system
  11255. result handler whenever you wish.
  11256.  
  11257. Result code
  11258. noErr                 0  No error
  11259. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11260.  
  11261. æKY DBRemoveResultHandler
  11262. æFc DatabaseAccess.h
  11263. æT Function
  11264. æTN A82F
  11265. æD pascal OSErr DBRemoveResultHandler(char dataType)
  11266.     = {0x303C,0x0215,0xA82F}; 
  11267. æDT OSErr myVariable = DBRemoveResultHandler((char) dataType);
  11268. æC 
  11269. The DBRemoveResultHandler function removes from memory the application result
  11270. handler for the data type that you specify with the dataType parameter. This
  11271. function cannot remove a system result handler. 
  11272.  
  11273. Result codes
  11274. noErr                 0  No error
  11275. rcDBNoHandler      –813  There is no handler for this data type installed 
  11276.                          for the current application
  11277. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11278.  
  11279. æKY DBGetResultHandler
  11280. æFc DatabaseAccess.h
  11281. æT Function
  11282. æTN A82F
  11283. æD pascal OSErr DBGetResultHandler(char dataType,ProcPtr *theHandler,Boolean getSysHandler)
  11284.     = {0x303C,0x0516,0xA82F}; 
  11285. æDT OSErr myVariable = DBGetResultHandler((char) dataType,(ProcPtr *) theHandler,(Boolean) getSysHandler);
  11286. æC 
  11287. The DBGetResultHandler function returns a pointer to a result handler for the
  11288. data type specified with the dataType parameter. The pointer is returned in the
  11289. parameter theHandler.
  11290.  
  11291. If you set the isSysHandler parameter to FALSE (0), the function returns a
  11292. pointer to the current application result handler for the specified data type,
  11293. or it returns 0 if there is no application result handler for that data type. If
  11294. you set the isSysHandler parameter to TRUE (nonzero), the function returns a
  11295. pointer to the current system result handler for the specified data type, or it
  11296. returns 0 if there is no system result handler for that data type.
  11297.  
  11298. You can use this function to obtain a pointer to a result handler so that you
  11299. can use it to convert to text  an individual data item retrieved by the
  11300. DBGetItem function. The DBGetQueryResults function automatically converts to
  11301. text all of the data pointed to by the results record.
  11302.  
  11303. Result codes
  11304. noErr                 0  No error
  11305. rcDBNoHandler      –813  There is no handler for this data type installed
  11306. rcDBPackNotInited  –815  The InitDBPack function has not yet been called
  11307.  
  11308.  
  11309. æKY DDEV.h
  11310. æKL 
  11311. DDEVFlags
  11312. DDEVParams
  11313. DDEVParamsPtr
  11314. kAsyncSupported
  11315. kDBBreak
  11316. kDBClose
  11317. kDBEnd
  11318. kDBExec
  11319. kDBGetConnInfo
  11320. kDBGetErr
  11321. kDBGetItem
  11322. kDBGetSessionNum
  11323. kDBIdle
  11324. kDBInit
  11325. kDBKill
  11326. kDBOpen
  11327. kDBSend
  11328. kDBSendItem
  11329. kDBState
  11330. kDBUnGetItem
  11331. kDDEVFlags
  11332. kDDEVID
  11333. kDDEVName
  11334.  
  11335. æKY kDBInit
  11336. æFc DDEV.h
  11337. æT #define
  11338. æD 
  11339. /*  messages for ddev  */
  11340.  
  11341. #define kDBInit 0
  11342. æC 
  11343.  
  11344. æKY kDBEnd
  11345. æFc DDEV.h
  11346. æT #define
  11347. æD #define kDBEnd 1
  11348. æC 
  11349.  
  11350. æKY kDBGetConnInfo
  11351. æFc DDEV.h
  11352. æT #define
  11353. æD #define kDBGetConnInfo 2
  11354. æC 
  11355.  
  11356. æKY kDBGetSessionNum
  11357. æFc DDEV.h
  11358. æT #define
  11359. æD #define kDBGetSessionNum 3
  11360. æC 
  11361.  
  11362. æKY kDBSend
  11363. æFc DDEV.h
  11364. æT #define
  11365. æD #define kDBSend 4
  11366. æC 
  11367.  
  11368. æKY kDBSendItem
  11369. æFc DDEV.h
  11370. æT #define
  11371. æD #define kDBSendItem 5
  11372. æC 
  11373.  
  11374. æKY kDBExec
  11375. æFc DDEV.h
  11376. æT #define
  11377. æD #define kDBExec 6
  11378. æC 
  11379.  
  11380. æKY kDBState
  11381. æFc DDEV.h
  11382. æT #define
  11383. æD #define kDBState 7
  11384. æC 
  11385.  
  11386. æKY kDBGetErr
  11387. æFc DDEV.h
  11388. æT #define
  11389. æD #define kDBGetErr 8
  11390. æC 
  11391.  
  11392. æKY kDBBreak
  11393. æFc DDEV.h
  11394. æT #define
  11395. æD #define kDBBreak 9
  11396. æC 
  11397.  
  11398. æKY kDBGetItem
  11399. æFc DDEV.h
  11400. æT #define
  11401. æD #define kDBGetItem 10
  11402. æC 
  11403.  
  11404. æKY kDBUnGetItem
  11405. æFc DDEV.h
  11406. æT #define
  11407. æD #define kDBUnGetItem 11
  11408. æC 
  11409.  
  11410. æKY kDBKill
  11411. æFc DDEV.h
  11412. æT #define
  11413. æD #define kDBKill 12
  11414. æC 
  11415.  
  11416. æKY kDBOpen
  11417. æFc DDEV.h
  11418. æT #define
  11419. æD #define kDBOpen 100
  11420. æC 
  11421.  
  11422. æKY kDBClose
  11423. æFc DDEV.h
  11424. æT #define
  11425. æD #define kDBClose 101
  11426. æC 
  11427.  
  11428. æKY kDBIdle
  11429. æFc DDEV.h
  11430. æT #define
  11431. æD #define kDBIdle 102
  11432. æC 
  11433.  
  11434. æKY kDDEVName
  11435. æFc DDEV.h
  11436. æT #define
  11437. æD 
  11438. /*  resource IDs of misc. resources  */
  11439.  
  11440. #define kDDEVName 128 /* ID of 'STR ' resource with ddev name */
  11441. æC 
  11442.  
  11443. æKY kDDEVID
  11444. æFc DDEV.h
  11445. æT #define
  11446. æD #define kDDEVID 128 /* ID of 'ddev' resource */
  11447. æC 
  11448.  
  11449. æKY kDDEVFlags
  11450. æFc DDEV.h
  11451. æT #define
  11452. æD #define kDDEVFlags 128 /* ID of 'dflg' resource */
  11453. æC 
  11454.  
  11455. æKY kAsyncSupported
  11456. æFc DDEV.h
  11457. æT #define
  11458. æD #define kAsyncSupported 0x00000001 /* bit for async support */
  11459. æC 
  11460.  
  11461. æKY DDEVFlags
  11462. æFc DDEV.h
  11463. æT struct
  11464. æD struct DDEVFlags {
  11465.     long version; /* always 0 for this release */
  11466.     long flags; /* flags */
  11467. };
  11468.  
  11469. typedef struct DDEVFlags DDEVFlags;
  11470. æC 
  11471.  
  11472. æKY DDEVParams
  11473. DDEVParamsPtr
  11474. æFc DDEV.h
  11475. æT struct
  11476. æD struct DDEVParams {
  11477.     Short message; /* action for ddev */
  11478.     long ddevStorage; /* storage for ddev */
  11479.     DBAsyncParmBlkPtr asyncPB; /* async parameter block pointer */
  11480.     long sessID; /* session ID */
  11481.     long returnedID; /* session ID returned by DBGetConnInfo */
  11482.     long version; /* version returned by DBGetConnInfo */
  11483.     long start; /* start returned by DBGetConnInfo */
  11484.     StringPtr host; /* host for DBInit and DBGetConnInfo */
  11485.     StringPtr user; /* user for DBInit and DBGetConnInfo */
  11486.     StringPtr password; /* password for DBInit and DBGetConnInfo */
  11487.     StringPtr connStr; /* connection string for DBInit and DBGetConnInfo */
  11488.     StringPtr network; /* network for DBInit and DBGetConnInfo */
  11489.     Ptr buffer; /* buffer used in several calls */
  11490.     long err1; /* error 1 for DGGetErr */
  11491.     long err2; /* error 2 for DGGetErr */
  11492.     StringPtr item1; /* item 1 for DGGetErr */
  11493.     StringPtr item2; /* item 2 for DGGetErr */
  11494.     StringPtr errorMsg; /* errorMsg for DGGetErr */
  11495.     long timeout; /* timeout for DGGetItem*/
  11496.     DBType dataType; /* type for several calls */
  11497.     Short sessNum; /* session number for DBGetConnInfo and DBGetSessionNum*/
  11498.     Short state; /* state for DBGetConnInfo */
  11499.     Short len; /* length of buffer */
  11500.     Short places; /* places for DBSendItem and DBGetItem */
  11501.     Short flags; /* flags for DBSendItem and DBGetItem */
  11502.     Boolean abort; /* abort for DBBreak */
  11503. };
  11504.  
  11505. typedef struct DDEVParams DDEVParams;
  11506. typedef DDEVParams *DDEVParamsPtr;
  11507.  
  11508. æC 
  11509.  
  11510.  
  11511. æKY Desk.h
  11512. æKL CloseDeskAcc
  11513. opendeskacc
  11514. OpenDeskAcc
  11515. SystemClick
  11516. SystemEdit
  11517. SystemEvent
  11518. SystemMenu
  11519. SystemTask
  11520.  
  11521. accClear
  11522. accCopy
  11523. accCursor
  11524. accCut
  11525. accEvent
  11526. accMenu
  11527. accPaste
  11528. accRun
  11529. accUndo
  11530. goodbye
  11531.  
  11532. æKY accEvent
  11533. æFc Desk.h
  11534. æT #define
  11535. æD #define accEvent 64
  11536. æC 
  11537.  
  11538. æKY accRun
  11539. æFc Desk.h
  11540. æT #define
  11541. æD #define accRun 65
  11542. æC 
  11543.  
  11544. æKY accCursor
  11545. æFc Desk.h
  11546. æT #define
  11547. æD #define accCursor 66
  11548. æC 
  11549.  
  11550. æKY accMenu
  11551. æFc Desk.h
  11552. æT #define
  11553. æD #define accMenu 67
  11554. æC 
  11555.  
  11556. æKY accUndo
  11557. æFc Desk.h
  11558. æT #define
  11559. æD #define accUndo 68
  11560. æC 
  11561.  
  11562. æKY accCut
  11563. æFc Desk.h
  11564. æT #define
  11565. æD #define accCut 70
  11566. æC 
  11567.  
  11568. æKY accCopy
  11569. æFc Desk.h
  11570. æT #define
  11571. æD #define accCopy 71
  11572. æC 
  11573.  
  11574. æKY accPaste
  11575. æFc Desk.h
  11576. æT #define
  11577. æD #define accPaste 72
  11578. æC 
  11579.  
  11580. æKY accClear
  11581. æFc Desk.h
  11582. æT #define
  11583. æD #define accClear 73
  11584. æC 
  11585.  
  11586. æKY goodbye
  11587. æFc Desk.h
  11588. æT #define
  11589. æD #define goodbye -1 /*goodbye message*/
  11590. æC 
  11591.  
  11592. æKY OpenDeskAcc
  11593. æFc Desk.h
  11594. æT Function
  11595. æTN A9B6
  11596. æD pascal short OpenDeskAcc(const Str255 theAcc)
  11597.     = 0xA9B6; 
  11598. æDT short myVariable = OpenDeskAcc((const Str255) theAcc);
  11599. æMM
  11600. æRI I-440
  11601. æC 
  11602. OpenDeskAcc opens the desk accessory having the given name and displays its window
  11603. (if any) as the active window. The name is the accessory’s resource name, which you
  11604. get from the Apple menu by calling the Menu Manager procedure GetItem. OpenDeskAcc
  11605. calls the Resource Manager to read the desk accessory from the resource file into the
  11606. application heap.
  11607.  
  11608. You should ignore the value returned by OpenDeskAcc. If the desk accessory is successfully
  11609. opened, the function result is its driver reference number. However, if the desk
  11610. accessory can’t be opened, the function result is undefined; the accessory will have
  11611. taken care of informing the user of the problem (such as memory full) and won’t
  11612. display itself.
  11613.  
  11614. Warning:  Early versions of some desk accessories may set the current
  11615.           grafPort to the accessory’s port upon return from OpenDeskAcc.
  11616.           To be safe, you should bracket your call to OpenDeskAcc with
  11617.           calls to the QuickDraw procedures GetPort and SetPort, to save
  11618.           and restore the current port.
  11619.  
  11620. Note:  Programmers concerned about the amount of available memory should
  11621.        be aware that an open desk accessory uses from 1K to 3K bytes of
  11622.        heap space in addition to the space needed for the accessory itself.
  11623.        The desk accessory is responsible for determining whether there is
  11624.        sufficient memory for it to run; this can be done by calling
  11625.        SizeResource followed by ResrvMem.
  11626.  
  11627. æKY CloseDeskAcc
  11628. æFc Desk.h
  11629. æT Function
  11630. æTN A9B7
  11631. æD pascal void CloseDeskAcc(short refNum)
  11632.     = 0xA9B7; 
  11633. æDT CloseDeskAcc((short) refNum);
  11634. æRI I-440
  11635. æC 
  11636. When a system window is active and the user chooses Close from the File menu, call
  11637. CloseDeskAcc to close the desk accessory. RefNum is the driver reference number for
  11638. the desk accessory, which you get from the windowKind field of its window.
  11639.  
  11640. The Desk Manager automatically closes a desk accessory if the user clicks its close
  11641. box. Also, since the application heap is released when the application terminates,
  11642. every desk accessory goes away at that time.
  11643.  
  11644. æKY SystemClick
  11645. æFc Desk.h
  11646. æT Function
  11647. æTN A9B3
  11648. æD pascal void SystemClick(const EventRecord *theEvent,WindowPtr theWindow)
  11649.     = 0xA9B3; 
  11650. æDT SystemClick((const EventRecord *) theEvent,(WindowPtr) theWindow);
  11651. æMM
  11652. æRI I-441, P-35, 182
  11653. æC 
  11654. When a mouse-down event occurs and the Window Manager function FindWindow reports
  11655. that the mouse button was pressed in a system window, the application should call
  11656. SystemClick with the event record and the window pointer. If the given window belongs
  11657. to a desk accessory, SystemClick sees that the event gets handled properly.
  11658.  
  11659. SystemClick determines which part of the desk accessory’s window the mouse button was
  11660. pressed in, and responds accordingly (similar to the way your application responds to
  11661. mouse activities in its own windows).
  11662.  
  11663.   •  If the mouse button was pressed in the content region of the window
  11664.      and the window was active, SystemClick sends the mouse-down event to
  11665.      the desk accessory, which processes it as appropriate.
  11666.   •  If the mouse button was pressed in the content region and the window
  11667.      was inactive, SystemClick makes it the active window.
  11668.   •  If the mouse button was pressed in the drag region, SystemClick calls
  11669.      the Window Manager procedure DragWindow to pull an outline of the window
  11670.      across the screen and move the window to a new location. If the window
  11671.      was inactive, DragWindow also makes it the active window (unless the
  11672.      Command key was pressed along with the mouse button).
  11673.   •  If the mouse button was pressed in the go-away region, SystemClick calls
  11674.      the Window Manager function TrackGoAway to determine whether the mouse
  11675.      is still inside the go-away region when the click is completed:  If
  11676.      so, it tells the desk accessory to close itself; otherwise, it does
  11677.      nothing.
  11678.  
  11679. æKY SystemEdit
  11680. æFc Desk.h
  11681. æT Function
  11682. æTN A9C2
  11683. æD pascal Boolean SystemEdit(short editCmd)
  11684.     = 0xA9C2; 
  11685. æDT Boolean myVariable = SystemEdit((short) editCmd);
  11686. æMM
  11687. æRT 180, 215
  11688. æRI I-441
  11689. æC 
  11690. Assembly-language note:  The macro you invoke to call SystemEdit from
  11691.                          assembly language is named _SysEdit.
  11692.  
  11693. Call SystemEdit when there’s a mouse-down event in the menu bar and the user chooses
  11694. one of the five standard editing commands from the Edit menu. Pass one of the following
  11695. as the value of the editCmd parameter:
  11696.  
  11697.   editCmd    Editing command
  11698.  
  11699.     0            Undo
  11700.     2            Cut
  11701.     3            Copy
  11702.     4            Paste
  11703.     5            Clear
  11704.  
  11705. If your Edit menu contains these five commands in the standard arrangement (the order
  11706. listed above, with a dividing line between Undo and Cut), you can simply call
  11707.  
  11708.   SystemEdit(menuItem-1)
  11709.  
  11710. where menuItem is the menu item number.
  11711.  
  11712. If the active window doesn’t belong to a desk accessory, SystemEdit returns FALSE;
  11713. the application should then process the editing command as usual. If the active
  11714. window does belong to a desk accessory, SystemEdit asks that accessory to process the
  11715. command and returns TRUE; in this case, the application should ignore the command.
  11716.  
  11717. Note:  It’s up to the application to make sure desk accessories get
  11718.        their editing commands that are chosen from the Edit menu. In
  11719.        particular, make sure your application hasn’t disabled the Edit
  11720.        menu or any of the five standard commands when a desk accessory
  11721.        is activated.
  11722.  
  11723. æKY SystemTask
  11724. æFc Desk.h
  11725. æT Function
  11726. æTN A9B4
  11727. æD pascal void SystemTask(void)
  11728.     = 0xA9B4; 
  11729. æDT SystemTask()(void);
  11730. æRT 85
  11731. æRI I-442, 444, II-189, N85-1
  11732. æC 
  11733. For each open desk accessory (or other device driver performing periodic actions),
  11734. SystemTask causes the accessory to perform the periodic action defined for it, if any
  11735. such action has been defined and if the proper time period has passed since the
  11736. action was last performed. For example, a clock accessory can be defined such that
  11737. the second hand is to move once every second; the periodic action for the accessory
  11738. will be to move the second hand to the next position, and SystemTask will alert the
  11739. accessory every second to perform that action.
  11740.  
  11741. You should call SystemTask as often as possible, usually once every time through your
  11742. main event loop. Call it more than once if your application does an unusually large
  11743. amount of processing each time through the loop.
  11744.  
  11745. Note:  SystemTask should be called at least every sixtieth of a second.
  11746.  
  11747. æKY SystemEvent
  11748. æFc Desk.h
  11749. æT Function
  11750. æTN A9B2
  11751. æD pascal Boolean SystemEvent(const EventRecord *theEvent)
  11752.     = 0xA9B2; 
  11753. æDT Boolean myVariable = SystemEvent((const EventRecord *) theEvent);
  11754. æRT 5,85
  11755. æRI I-442, N5-1, N85-1
  11756. æC  
  11757. SystemEvent is called only by the Toolbox Event Manager function GetNextEvent when it
  11758. receives an event, to determine whether the event should be handled by the application
  11759. or by the system. If the given event should be handled by the application, SystemEvent
  11760. returns FALSE; otherwise, it calls the appropriate system code to handle the event
  11761. and returns TRUE.
  11762.  
  11763. In the case of a null or mouse-down event, SystemEvent does nothing but return FALSE.
  11764. Notice that it responds this way to a mouse-down event even though the event may in
  11765. fact have occurred in a system window (and therefore may have to be handled by the
  11766. system). The reason for this is that the check for exactly where the event occurred
  11767. (via the Window Manager function FindWindow) is made later by the application and so
  11768. would be made twice if SystemEvent were also to do it. To avoid this duplication,
  11769. SystemEvent passes the event on to the application and lets it make the sole call to
  11770. FindWindow. Should FindWindow reveal that the mouse-down event did occur in a system
  11771. window, the application can then call SystemClick, as described above, to get the
  11772. system to handle it.
  11773.  
  11774. If the given event is a mouse-up or any keyboard event (including keyboard equivalents
  11775. of commands), SystemEvent checks whether the active window belongs to a desk accessory
  11776. and whether that accessory can handle this type of event. If so, it sends the event
  11777. to the desk accessory and returns TRUE; otherwise, it returns FALSE.
  11778.  
  11779. If SystemEvent is passed an activate or update event, it checks whether the window
  11780. the event occurred in is a system window belonging to a desk accessory and whether
  11781. that accessory can handle this type of event. If so, it sends the event to the desk
  11782. accessory and returns TRUE; otherwise, it returns FALSE.
  11783.  
  11784. Note:  It’s unlikely that a desk accessory would not be set up to handle
  11785.        keyboard, activate, and update events, or that it would handle
  11786.        mouse-up events.
  11787.  
  11788.        If the given event is a disk-inserted event, SystemEvent does some
  11789.        low-level processing (by calling the File Manager function MountVol)
  11790.        but passes the event on to the application by returning FALSE, in
  11791.        case the application wants to do further processing. Finally,
  11792.        SystemEvent returns FALSE for network, device driver, and
  11793.        application-defined events.
  11794.  
  11795. Assembly-language note:  Advanced programmers can make SystemEvent
  11796.                          always return FALSE by setting the global
  11797.                          variable SEvtEnb (a byte) to 0.
  11798.  
  11799. æKY SystemMenu
  11800. æFc Desk.h
  11801. æT Function
  11802. æTN A9B5
  11803. æD pascal void SystemMenu(long menuResult)
  11804.     = 0xA9B5; 
  11805. æDT SystemMenu((long) menuResult);
  11806. æMM
  11807. æRI I-443
  11808. æC  
  11809. SystemMenu is called only by the Menu Manager functions MenuSelect and MenuKey, when
  11810. an item in a menu belonging to a desk accessory has been chosen. The menuResult
  11811. parameter has the same format as the value returned by MenuSelect and MenuKey:  the
  11812. menu ID in the high-order word and the menu item number in the low-order word. (The
  11813. menu ID will be negative.) SystemMenu directs the desk accessory to perform the
  11814. appropriate action for the given menu item.
  11815.  
  11816. æKY opendeskacc
  11817. æFc Desk.h
  11818. æT Function
  11819. æD short opendeskacc(char *theAcc); 
  11820. æDT short myVariable = opendeskacc((char *) theAcc);
  11821. æMM
  11822. æRI I-440
  11823. æC 
  11824. OpenDeskAcc opens the desk accessory having the given name and displays its window
  11825. (if any) as the active window. The name is the accessory’s resource name, which you
  11826. get from the Apple menu by calling the Menu Manager procedure GetItem. OpenDeskAcc
  11827. calls the Resource Manager to read the desk accessory from the resource file into the
  11828. application heap.
  11829.  
  11830. You should ignore the value returned by OpenDeskAcc. If the desk accessory is successfully
  11831. opened, the function result is its driver reference number. However, if the desk
  11832. accessory can’t be opened, the function result is undefined; the accessory will have
  11833. taken care of informing the user of the problem (such as memory full) and won’t
  11834. display itself.
  11835.  
  11836. Warning:  Early versions of some desk accessories may set the current
  11837.           grafPort to the accessory’s port upon return from OpenDeskAcc.
  11838.           To be safe, you should bracket your call to OpenDeskAcc with
  11839.           calls to the QuickDraw procedures GetPort and SetPort, to save
  11840.           and restore the current port.
  11841.  
  11842. Note:  Programmers concerned about the amount of available memory should
  11843.        be aware that an open desk accessory uses from 1K to 3K bytes of
  11844.        heap space in addition to the space needed for the accessory itself.
  11845.        The desk accessory is responsible for determining whether there is
  11846.        sufficient memory for it to run; this can be done by calling
  11847.        SizeResource followed by ResrvMem.
  11848.  
  11849.  
  11850. æKY DeskBus.h
  11851. æKL ADBOp
  11852. ADBReInit
  11853. CountADBs
  11854. GetADBInfo
  11855. GetIndADB
  11856. SetADBInfo
  11857.  
  11858. ADBAddress
  11859. ADBDataBlock
  11860. ADBDBlkPtr
  11861. ADBOpBlock
  11862. ADBOpBPtr
  11863. ADBSetInfoBlock
  11864. ADBSInfoPtr
  11865.  
  11866. æKY ADBAddress
  11867. æFc DeskBus.h
  11868. æT typedef
  11869. æD typedef char ADBAddress;
  11870. æC 
  11871.  
  11872. æKY ADBOpBlock
  11873. ADBOpBPtr
  11874. æFc DeskBus.h
  11875. æT struct
  11876. æD struct ADBOpBlock {
  11877.     Ptr dataBuffPtr; /*address of data buffer*/
  11878.     Ptr opServiceRtPtr; /*service routine pointer*/
  11879.     Ptr opDataAreaPtr; /*optional data area address*/
  11880. };
  11881.  
  11882. typedef struct ADBOpBlock ADBOpBlock;
  11883. typedef ADBOpBlock *ADBOpBPtr;
  11884.  
  11885. æC 
  11886.  
  11887. æKY ADBDataBlock
  11888. ADBDBlkPtr
  11889. æFc DeskBus.h
  11890. æT struct
  11891. æD struct ADBDataBlock {
  11892.     char devType; /*device type*/
  11893.     char origADBAddr; /*original ADB Address*/
  11894.     Ptr dbServiceRtPtr; /*service routine pointer*/
  11895.     Ptr dbDataAreaAddr; /*data area address*/
  11896. };
  11897.  
  11898. typedef struct ADBDataBlock ADBDataBlock;
  11899. typedef ADBDataBlock *ADBDBlkPtr;
  11900.  
  11901. æC 
  11902.  
  11903. æKY ADBSetInfoBlock
  11904. ADBSInfoPtr
  11905. æFc DeskBus.h
  11906. æT struct
  11907. æD struct ADBSetInfoBlock {
  11908.     Ptr siServiceRtPtr; /*service routine pointer*/
  11909.     Ptr siDataAreaAddr; /*data area address*/
  11910. };
  11911.  
  11912. typedef struct ADBSetInfoBlock ADBSetInfoBlock;
  11913. typedef ADBSetInfoBlock *ADBSInfoPtr;
  11914.  
  11915. æC 
  11916.  
  11917. æKY ADBReInit
  11918. æFc DeskBus.h
  11919. æT Function
  11920. æTN A07B
  11921. æD pascal void ADBReInit(void)
  11922.     = 0xA07B; 
  11923. æDT ADBReInit()(void);
  11924. æMM
  11925. æRT 143, 206 
  11926. æRI V-367, N143
  11927. æC 
  11928. Trap macro    _ADBReInit
  11929.  
  11930. ADBReInit reinitializes the entire Apple Desktop Bus. It clears the ADB device table
  11931. to zeros and places a SendReset command on the bus to reset all devices to their
  11932. original addresses. ADBReInit has no parameters.
  11933.  
  11934. Because it does not deallocate ADB resources on the system heap, ADBReInit should not
  11935. be used for routine bus initialization. Apple strongly recommends against adding
  11936. devices while the system is running; therefore, you should never call ADBReInit.
  11937.  
  11938. ADBReInit also calls a routine pointed to by the low memory global JADBProc
  11939. at the beginning and end of its execution.  You can insert your own
  11940. preprocessing/postprocessing routine by changing the value of JADBProc; ADBReInit
  11941. conditions it by setting D0 to 0 for preprocessing and to 1 for postprocessing.  Your
  11942. procedure must restore the value of D0 and branch to the original value of JADBProc
  11943. on exit.  JADBProc should be used to de-allocate memory used by the driver (see
  11944. MacDTS Sample Code “TbltDrvr” for an example), and then it should chain to the procedure
  11945. originally found in JADBProc.
  11946.  
  11947. The complete ADBReInit sequence is therefore the following:
  11948.  
  11949.   •  JSR to JADBProc with D0 set to 0
  11950.   •  reinitialize the Apple Desktop Bus
  11951.   •  clear the ADB device table
  11952.   •  JSR to JADBProc with D0 set to 1
  11953.  
  11954. æKY ADBOp
  11955. æFc DeskBus.h
  11956. æT Function
  11957. æD pascal OSErr ADBOp(Ptr data,ProcPtr compRout,Ptr buffer,short commandNum); 
  11958. æDT OSErr myVariable = ADBOp((Ptr) data,(ProcPtr) compRout,(Ptr) buffer,(short) commandNum);
  11959. æRT 206
  11960. æRI V-368
  11961. æC 
  11962. Trap macro    _ADBOp
  11963.  
  11964. On entry:    A0:  pointer to parameter block
  11965.              D0:  commandNum (byte)
  11966.  
  11967. Parameter block
  11968.     -->    0    buffer      pointer
  11969.     -->    4    compRout    pointer
  11970.     -->    8    data        pointer
  11971.  
  11972. On exit:     D0:  result code (byte)
  11973.  
  11974. The completion routine pointed to by compRout will be passed the following parameters
  11975. on entry:
  11976.  
  11977.              D0:  commandNum (byte)
  11978.              A0:  pointer to buffer, data stored as a Pascal string (maximum
  11979.                   8 bytes data preceded by one length byte)
  11980.              A1:  pointer to completion routine (compRout)
  11981.              A2:  pointer to optional data area (data)
  11982.  
  11983. ADBOp transmits over the bus the command byte whose value is given by commandNum. The
  11984. structure of the command byte is given earlier in Figure 1. ADBOp executes only when
  11985. the ADB is otherwise idle; otherwise it is held in a command queue. It returns an
  11986. error if the command queue is full. The length of the data buffer pointed to by
  11987. buffer is contained in its first byte, like a Pascal string. The optional data area
  11988. pointed to by data is for local storage by the completion routine pointed to by
  11989. compRout. ADBop should be used sparingly; it is not intended for polling a device. 
  11990. The host automatically polls devices with data to deliver.
  11991.  
  11992. Result codes    noErr    No error
  11993.                 –1       Unsuccessful completion
  11994.  
  11995. æKY CountADBs
  11996. æFc DeskBus.h
  11997. æT Function
  11998. æD pascal short CountADBs(void); 
  11999. æDT short myVariable = CountADBs()(void);
  12000. æRT 206
  12001. æRI V-369
  12002. æC 
  12003. Trap macro    _CountADBs
  12004.  
  12005. On exit:    D0:  number of devices (byte)
  12006.  
  12007. CountADBs returns a value representing the number of devices connected to the ADB by
  12008. counting the number of entries in the device table. It has no arguments and returns
  12009. no error codes.
  12010.  
  12011. æKY GetIndADB
  12012. æFc DeskBus.h
  12013. æT Function
  12014. æD pascal ADBAddress GetIndADB(ADBDataBlock *info,short devTableIndex); 
  12015. æDT ADBAddress myVariable = GetIndADB((ADBDataBlock *) info,(short) devTableIndex);
  12016. æRT 206
  12017. æRI V-369
  12018. æC 
  12019. Trap macro    _GetIndADB
  12020.  
  12021. On entry:    A0:  pointer to parameter block
  12022.              D0:  entry index number; range = 1..CountADBs (byte)
  12023.  
  12024. Parameter block
  12025.     <--    0    device type                byte    (handler ID)
  12026.     <--    1    original ADB address       byte
  12027.     <--    2    service routine address    pointer (compRout)
  12028.     <--    6    data area address          pointer (data)
  12029.  
  12030. On exit:     D0:  positive value:  current ADB address (byte)
  12031.                   negative value:  error code (byte)
  12032.  
  12033. GetIndADB returns information from the ADB device table entry whose index number is
  12034. given by devTableIndex. ADBDataBlock has this form:
  12035.  
  12036. TYPE  ADBDataBlock =
  12037.              PACKED RECORD
  12038.                devType:         SignedByte; {device type (handler ID)}
  12039.                origADBAddr:     SignedByte; {original ADB address}
  12040.                dbServiceRtPtr:  Ptr;        {service routine address (compRout)}
  12041.                dbDataAreaAddr:  Ptr         {data area address (data)}
  12042.              END;
  12043.  
  12044. GetIndADB returns the current ADB address of the device. If it is unable to complete
  12045. execution successfully, GetIndADB returns a negative value.
  12046.  
  12047. æKY GetADBInfo
  12048. æFc DeskBus.h
  12049. æT Function
  12050. æD pascal OSErr GetADBInfo(ADBDataBlock *info,ADBAddress adbAddr); 
  12051. æDT OSErr myVariable = GetADBInfo((ADBDataBlock *) info,(ADBAddress) adbAddr);
  12052. æRI V-370
  12053. æC 
  12054. Trap macro    _GetADBInfo
  12055.  
  12056. On entry:    A0:  pointer to parameter block
  12057.              D0:  ADB address of the device (byte)
  12058.  
  12059. Parameter block
  12060.     <--    0    device handler ID          byte
  12061.     <--    1    original ADB address       byte
  12062.     <--    2    service routine address    pointer (compRout)
  12063.     <--    6    data area address          pointer (data)
  12064.  
  12065. On exit:     D0:  result code (byte)
  12066.  
  12067. GetADBInfo returns information from the ADB device table entry of the device whose
  12068. ADB address is given by ABDAddr. The structure of ADBDataBlock is given above under
  12069. “GetIndADB”.
  12070.  
  12071. Result codes    noErr    No error
  12072.  
  12073. æKY SetADBInfo
  12074. æFc DeskBus.h
  12075. æT Function
  12076. æD pascal OSErr SetADBInfo(ADBSetInfoBlock *info,ADBAddress adbAddr); 
  12077. æDT OSErr myVariable = SetADBInfo((ADBSetInfoBlock *) info,(ADBAddress) adbAddr);
  12078. æRT 206
  12079. æRI V-370
  12080. æC 
  12081. Trap macro    _SetADBInfo
  12082.  
  12083. On entry:    A0:  pointer to parameter block
  12084.              D0:  ADB address of the device (byte)
  12085.  
  12086. Parameter block
  12087.     -->    0    service routine address    pointer (compRout)
  12088.     -->    4    data area address          pointer (data)
  12089.  
  12090. On exit:     D0:  result code (byte)
  12091.  
  12092. SetADBInfo sets the service routine address and the data area address in the ADB
  12093. device table entry for the device whose ADB address is given by ABDAddr. ADBSetInfoBlock
  12094. has this form:
  12095.  
  12096. TYPE  ADBSetInfoBlock =
  12097.                RECORD
  12098.                  siServiceRtPtr:  Ptr;  {service routine address (compRout)}
  12099.                  siDataAreaAddr:  Ptr   {data area address (data)}
  12100.                END;
  12101.  
  12102. Result codes    noErr    No error
  12103.  
  12104. Warning:  You should send a Flush command to the device after calling it
  12105.           with SetADBInfo, to prevent it sending old data to the new data
  12106.           area address.
  12107.  
  12108.  
  12109. æKY Devices.h
  12110. æKL CloseDriver
  12111. Control
  12112. GetDCtlEntry
  12113. KillIO
  12114. opendriver
  12115. OpenDriver
  12116. PBControl
  12117. PBKillIO
  12118. PBStatus
  12119. SetChooserAlert
  12120. Status
  12121.  
  12122. activDev
  12123. AuxDCE
  12124. AuxDCEHandle
  12125. AuxDCEPtr
  12126. buttonMsg
  12127. cdevGenErr
  12128. cdevMemErr
  12129. cdevResErr
  12130. cdevUnset
  12131. chooserID
  12132. clearDev
  12133. closeDev
  12134. copyDev
  12135. cursorDev
  12136. cutDev
  12137. DCtlEntry
  12138. DCtlHandle
  12139. DCtlPtr
  12140. deactivDev
  12141. deselectMsg
  12142. fillListMsg
  12143. getSelMsg
  12144. hitDev
  12145. initDev
  12146. keyEvtDev
  12147. macDev
  12148. newSelMsg
  12149. nulDev
  12150. pasteDev
  12151. selectMsg
  12152. terminateMsg
  12153. undoDev
  12154. updateDev
  12155.  
  12156. æKY newSelMsg
  12157. æFc Devices.h
  12158. æT #define
  12159. æD #define newSelMsg 12
  12160. æC 
  12161.  
  12162. æKY fillListMsg
  12163. æFc Devices.h
  12164. æT #define
  12165. æD #define fillListMsg 13
  12166. æC 
  12167.  
  12168. æKY getSelMsg
  12169. æFc Devices.h
  12170. æT #define
  12171. æD #define getSelMsg 14
  12172. æC 
  12173.  
  12174. æKY selectMsg
  12175. æFc Devices.h
  12176. æT #define
  12177. æD #define selectMsg 15
  12178. æC 
  12179.  
  12180. æKY deselectMsg
  12181. æFc Devices.h
  12182. æT #define
  12183. æD #define deselectMsg 16
  12184. æC 
  12185.  
  12186. æKY terminateMsg
  12187. æFc Devices.h
  12188. æT #define
  12189. æD #define terminateMsg 17
  12190. æC 
  12191.  
  12192. æKY buttonMsg
  12193. æFc Devices.h
  12194. æT #define
  12195. æD #define buttonMsg 19
  12196. æC 
  12197.  
  12198. æKY chooserID
  12199. æFc Devices.h
  12200. æT #define
  12201. æD #define chooserID 1
  12202. æC 
  12203.  
  12204. æKY initDev
  12205. æFc Devices.h
  12206. æT #define
  12207. æD #define initDev 0 /*Time for cdev to initialize itself*/
  12208. æC 
  12209. »The initDev Message
  12210.  
  12211. InitDev is an initialization message sent to allow the cdev to allocate its private
  12212. storage (if any) and do any initial settings to buttons or controls.  This message is
  12213. sent when the user clicks on the cdev’s icon.
  12214.  
  12215. Note that the dialog, cdev list, and all of the items in the cdev’s 'DITL' except
  12216. user items will already have been drawn when the initDev message is sent.
  12217.  
  12218. If your cdev doesn’t need any storage it should return the value that was passed to
  12219. it in cdevValue.
  12220.  
  12221. æKY hitDev
  12222. æFc Devices.h
  12223. æT #define
  12224. æD #define hitDev 1 /*Hit on one of my items*/
  12225. æC »The hitDev Message
  12226.  
  12227. A hitDev message is sent when the user has clicked an enabled dialog item that belongs
  12228. to the cdev.  The dialog item number of the item hit is passed in the Item parameter.
  12229.  Remember that the Control Panel’s items precede yours, so
  12230. you’ll want (Item – numItems) to determine which of your items was hit.  If the
  12231. Control Panel itself has n items, the first of the cdev’s items will be n+1 in the
  12232. combined dialog item list.  A cdev should not depend on any hardcoded value for
  12233. numItems, since the number of items in Control Panel’s 'DITL' is likely to change in
  12234. the future.
  12235.  
  12236. Factoring in numItems need not mean an increase in your code size, or passing and
  12237. adding numItems everywhere, or foregoing the constants that most developers use to
  12238. identify specific items.  You can do it easily, and neatly, as follows:
  12239.  
  12240.   1.  Subtract numItems from Item right away, and refer to your dialog
  12241.       items with constants as usual throughout the cdev.
  12242.   2.  Write simple envelope routines to enclose Dialog Manager procedures
  12243.       that require item number arguments.  Add numItems only locally,
  12244.       within those routines and for the Dialog Manager calls only.
  12245.  
  12246. This is demonstrated in the sample cdev.
  12247.  
  12248. æKY closeDev
  12249. æFc Devices.h
  12250. æT #define
  12251. æD #define closeDev 2 /*Close yourself*/
  12252. æC 
  12253.  
  12254. æKY nulDev
  12255. æFc Devices.h
  12256. æT #define
  12257. æD #define nulDev 3 /*Null event*/
  12258. æC »The nulDev Message
  12259.  
  12260. A nulDev message is sent to the cdev on every Control Panel run event.  This allows
  12261. the cdev to perform tasks that need to be executed continuously
  12262. (insertion point blinking, for example).
  12263.  
  12264. A cdev cannot assume any particular timing of calls from applications.  Don’t use
  12265. nulDev to refresh settings; see activDev, above.
  12266.  
  12267. æKY updateDev
  12268. æFc Devices.h
  12269. æT #define
  12270. æD #define updateDev 4 /*Update event*/
  12271. æC 
  12272.  
  12273. æKY activDev
  12274. æFc Devices.h
  12275. æT #define
  12276. æD #define activDev 5 /*Activate event*/
  12277. æC 
  12278. #define activDev 5 /*Activate event*/
  12279.  
  12280. »The activDev Message
  12281.  
  12282. An activDev message is sent to the cdev on every activate event.  It allows the cdev
  12283. to reset any items that may have changed while the Control Panel was inactive.   It
  12284. also allows the cdev to send things such as “lists activate” messages.
  12285.  
  12286. æKY deactivDev
  12287. æFc Devices.h
  12288. æT #define
  12289. æD #define deactivDev 6 /*Deactivate event*/
  12290. æC 
  12291.  
  12292. æKY keyEvtDev
  12293. æFc Devices.h
  12294. æT #define
  12295. æD #define keyEvtDev 7 /*Key down/auto key*/
  12296. æC »The keyEvtDev Message
  12297.  
  12298. A keyEvtDev message is sent to the cdev on every keyDown event and autoKey event.  It
  12299. allows the cdev to process key events.  On return to the Control Panel, the key event
  12300. will be processed by a call to dialogSelect in the Dialog Manager.  A cdev that does
  12301. not want the Toolbox Event Manager to do any further processing should change the
  12302. what field of the EventRecord to nullEvent before returning to the Control Panel.
  12303.  
  12304. æKY macDev
  12305. æFc Devices.h
  12306. æT #define
  12307. æD #define macDev 8 /*Decide whether or not to show up*/
  12308. æC 
  12309.  
  12310. »The macDev Message
  12311.  
  12312. If the 'mach' resource has a 0 in Softmask and a –1 ($FFFF) in Hardmask, the first
  12313. message a cdev will get is a macDev message.  This is an opportunity for the cdev to
  12314. determine whether it can run, and whether it should appear in the Control Panel’s
  12315. cdev list.  The cdev can do its own check to see which machine it is being run on,
  12316. what hardware is connected, and what is in the slots (if it has slots).  The cdev
  12317. must then return a function result of 1 or 0.  If  a 0 is returned, the Control Panel
  12318. will not display the cdev in the icon list.  (Note that the Control Panel does not
  12319. interpret this 0 or 1 as an error message as described under “Cdev Error Checking”.)
  12320.  
  12321. The macDev call happens only once, and only when Softmask and Hardmask are 0 and
  12322. FFFF.  It is always the first call made to the cdev.
  12323. #define macDev   8 /*Decide whether or not to show up*/
  12324.  
  12325. æKY undoDev
  12326. æFc Devices.h
  12327. æT #define
  12328. æD #define undoDev 9
  12329. æC 
  12330.  
  12331. æKY cutDev
  12332. æFc Devices.h
  12333. æT #define
  12334. æD #define cutDev 10
  12335. æC 
  12336.  
  12337. æKY copyDev
  12338. æFc Devices.h
  12339. æT #define
  12340. æD #define copyDev 11
  12341. æC 
  12342.  
  12343. æKY pasteDev
  12344. æFc Devices.h
  12345. æT #define
  12346. æD #define pasteDev 12
  12347. æC 
  12348.  
  12349. æKY clearDev
  12350. æFc Devices.h
  12351. æT #define
  12352. æD #define clearDev 13
  12353. æC 
  12354.  
  12355. æKY cursorDev
  12356. æFc Devices.h
  12357. æT #define
  12358. æD #define cursorDev 14
  12359. æC 
  12360.  
  12361. æKY cdevGenErr
  12362. æFc Devices.h
  12363. æT #define
  12364. æD #define cdevGenErr -1 /*General error; gray cdev w/o alert*/
  12365. æC 
  12366.  
  12367. æKY cdevMemErr
  12368. æFc Devices.h
  12369. æT #define
  12370. æD #define cdevMemErr 0 /*Memory shortfall; alert user please*/
  12371. æC 
  12372.  
  12373. æKY cdevResErr
  12374. æFc Devices.h
  12375. æT #define
  12376. æD #define cdevResErr 1 /*Couldn't get a needed resource; alert*/
  12377. æC 
  12378.  
  12379. æKY cdevUnset
  12380. æFc Devices.h
  12381. æT #define
  12382. æD #define cdevUnset 3 /* cdevValue is initialized to this*/
  12383. æC 
  12384. »CDEV ERROR CHECKING
  12385. _______________________________________________________________________________
  12386.  
  12387. Because a desk accessory may be called into many strange and wonderful situations,
  12388. careful attention must be paid to error checking.  The two most common error conditions
  12389. are missing resources and lack of memory.  Some error reporting and recovery facilities
  12390. have been provided in the Control Panel to help with errors encountered in a cdev.
  12391.  
  12392. Because the Control Panel has no direct information about the cdev, the cdev’s code
  12393. must be able to detect and recover from error conditions on its own.  If the recovery
  12394. cannot be effected the cdev must dispose of any memory it has allocated, and exit
  12395. back to the Control Panel with an error code.
  12396.  
  12397. Following a shutdown, the Control Panel can help report the error condition to the
  12398. user and prevent accidental reentry into the cdev that might result from such things
  12399. as an update event.  A cdev can request three different error reporting mechanisms
  12400. from the Control Panel:
  12401.  
  12402.   •  If a memory error has occured, then, after the cdev has safely shut
  12403.      itself down, it may request the Control Panel to issue an out-of-memory
  12404.      error message and gray out (paint over with the background pattern) the
  12405.      cdev area of the Control Panel window.  It will remain grayed until
  12406.      another cdev is selected.  The Control Panel window itself is not
  12407.      closed since other cdevs may still be able to function in the environment.
  12408.   •  If a resource error is detected, the cdev may request that a
  12409.      can’t-find-needed-resource error message be issued.
  12410.   •  The cdev may display its own error message and then call on the
  12411.      Control Panel to gray its area.
  12412.  
  12413. The Control Panel uses the cdevValue parameter to send status information to the
  12414. cdev, and a proper cdev uses its function value to send information back to the
  12415. Control Panel.  In the absence of errors, the same value passes back and forth: the
  12416. Control Panel puts the last function value it received into cdevValue when it calls
  12417. the cdev; the cdev returns the value it finds there as the function value.  The cdev
  12418. may want to keep a handle to its own storage, in which case passing it as the function
  12419. value ensures its availability, since the Control Panel will pass it back in cdevValue
  12420. at the next call.
  12421.  
  12422. Four constants have been defined for this cdev/Control Panel communication:
  12423.  
  12424. #define  cdevUnset        3    /*initial value passed in cdevValue*/
  12425. #define  cdevGenErr      -1    /*generic cdev error*/
  12426. #define  cdevMemErr       0    /*insufficient memory for cdev execution*/
  12427. #define  cdevResErr       1    /*missing resource needed by cdev*/
  12428.  
  12429. After the macDev call, the Control Panel sends cdevUnset in cdevValue, so that until
  12430. an error occurs or the cdev uses its function value as a handle, cdevUnset is passed
  12431. back and forth.  If the cdev encounters an error, it should dispose of all handles
  12432. and pointers it has set up, strip the stack back to the same position as a normal
  12433. exit, and return one of the three error codes as the function result.  The Control
  12434. Panel will respond as follows:
  12435.  
  12436.   Function           Message to                     Control Panel Action    
  12437.   Result             Control Panel   
  12438.  
  12439.   cdevGenErr         The cdev has encountered an    Gray out the cdev’s area,
  12440.                      error from which it cannot     send a 0 in cdevValue in
  12441.                      recover, but do not put up     succeeding cdev calls
  12442.                      an error dialog.
  12443.  
  12444.   cdevMemErr         The cdev has determined that   Gray out cdev’s area, put
  12445.                      there is not enough memory to  up error dialog, send a 0
  12446.                      execute; please put up a       in cdevValue in succeeding
  12447.                      memory error dialog.           cdev calls.
  12448.  
  12449.   cdevResErr         The cdev can’t find a needed   Gray out cdev’s area, put
  12450.                      resource; please put up a      up error dialog, send a 0
  12451.                      resource error dialog.         in cdevValue in succeeding
  12452.                                                     cdev calls.
  12453.  
  12454.   all other values,  No error conditions.           Send the value back in
  12455.   either handles                                    cdevValue.
  12456.   or cdevUnset
  12457.  
  12458. The cdev code should check cdevValue at entry.  A 0 means that the Control Panel has
  12459. responded to a cdev error message by shutting down the cdev and displaying an error
  12460. dialog if one was requested.  The cdev should immediately exit.
  12461.  
  12462. Once the Control Panel has responded to an error message from a cdev it will no
  12463. longer respond to any return values until another cdev is launched.
  12464.  
  12465. æKY DCtlEntry
  12466. DCtlPtr
  12467. DCtlHandle
  12468. æFc Devices.h
  12469. æT struct
  12470. æD struct DCtlEntry {
  12471.     Ptr dCtlDriver;
  12472.     short dCtlFlags;
  12473.     QHdr dCtlQHdr;
  12474.     long dCtlPosition;
  12475.     Handle dCtlStorage;
  12476.     short dCtlRefNum;
  12477.     long dCtlCurTicks;
  12478.     WindowPtr dCtlWindow;
  12479.     short dCtlDelay;
  12480.     short dCtlEMask;
  12481.     short dCtlMenu;
  12482. };
  12483.  
  12484. typedef struct DCtlEntry DCtlEntry;
  12485. typedef DCtlEntry *DCtlPtr, **DCtlHandle;
  12486.  
  12487. æC 
  12488. »Device Control Entry
  12489.  
  12490. The first time a driver is opened, information about it is read into a structure in
  12491. memory called a device control entry. A device control entry contains the header of
  12492. the driver’s I/O queue, the location of the driver’s routines, and other information.
  12493. A device control entry is a 40-byte relocatable block located in the system heap.
  12494. It’s locked while the driver is open, and unlocked while the driver is closed.
  12495.  
  12496. Most of the data in the device control entry is stored and accessed only by the
  12497. Device Manager, but in some cases the driver itself must store into it. The structure
  12498. of a device control entry is shown below; note that the first four words of the
  12499. driver are copied into the dCtlFlags, dCtlDelay, dCtlEMask, and dCtlMenu fields.
  12500.  
  12501. TYPE  DCtlEntry = RECORD
  12502.                     dCtlDriver:    Ptr;        {pointer to ROM driver or }
  12503.                                                { handle to RAM driver}
  12504.                     dCtlFlags:     INTEGER;    {flags}
  12505.                     dCtlQHdr:      QHdr;       {driver I/O queue header}
  12506.                     dCtlPosition:  LONGINT;    {byte position used by Read }
  12507.                                                { and Write calls}
  12508.                     dCtlStorage:   Handle;     {handle to RAM driver's }
  12509.                                                { private storage}
  12510.                     dCtlRefNum:    INTEGER;    {driver reference number}
  12511.                     dCtlCurTicks:  LONGINT;    {used internally}
  12512.                     dCtlWindow:    WindowPtr;  {pointer to driver's window}
  12513.                     dCtlDelay:     INTEGER;    {number of ticks between }
  12514.                                                { periodic actions}
  12515.                     dCtlEMask:     INTEGER;    {desk accessory event mask}
  12516.                     dCtlMenu:      INTEGER     {menu ID of menu associated
  12517.                                                { with driver}
  12518.                   END;
  12519.  
  12520.       DCtlPtr    = ^DCtlEntry;
  12521.       DCtlHandle = ^DCtlPtr;
  12522.  
  12523. The low-order byte of the dCtlFlags word contains the following flags:
  12524.  
  12525. Bit number    Meaning
  12526.  
  12527.     5         Set if driver is open
  12528.     6         Set if driver is RAM-based
  12529.     7         Set if driver is currently executing
  12530.  
  12531. Assembly-language note:  These flags can be accessed with the global
  12532.                          constants dOpened, dRAMBased, and drvrActive.
  12533.  
  12534. The high-order byte of the dCtlFlags word contains flags copied from the drvrFlags
  12535. word of the driver, as described above.
  12536.  
  12537. DCtlQHdr contains the header of the driver’s I/O queue (described below). DCtlPosition
  12538. is used only by drivers of block devices, and indicates the current source or destination
  12539. position of a Read or Write call. The position is given as a number of bytes beyond
  12540. the physical beginning of the medium used by the device. For example, if one logical
  12541. block of data has just been read from a 3 1/2-inch disk via the Disk Driver, dCtlPosition
  12542. will be 512.
  12543.  
  12544. ROM drivers generally use locations in low memory for their local storage. RAM drivers
  12545. may reserve memory within their code space, or allocate a relocatable block and keep
  12546. a handle to it in dCtlStorage (if the block resides in the application heap, its
  12547. handle will be set to NIL when the heap is reinitialized).
  12548.  
  12549. You can get a handle to a driver’s device control entry by calling the Device Manager
  12550. function GetDCtlEntry.
  12551.  
  12552. æKY AuxDCE
  12553. AuxDCEPtr
  12554. AuxDCEHandle
  12555. æFc Devices.h
  12556. æT struct
  12557. æD struct AuxDCE {
  12558.     Ptr dCtlDriver;
  12559.     short dCtlFlags;
  12560.     QHdr dCtlQHdr;
  12561.     long dCtlPosition;
  12562.     Handle dCtlStorage;
  12563.     short dCtlRefNum;
  12564.     long dCtlCurTicks;
  12565.     GrafPtr dCtlWindow;
  12566.     short dCtlDelay;
  12567.     short dCtlEMask;
  12568.     short dCtlMenu;
  12569.     char dCtlSlot;
  12570.     char dCtlSlotId;
  12571.     long dCtlDevBase;
  12572.     Ptr dCtlOwner;
  12573.     char dCtlExtDev;
  12574.     char fillByte;
  12575. };
  12576.  
  12577. typedef struct AuxDCE AuxDCE;
  12578. typedef AuxDCE *AuxDCEPtr, **AuxDCEHandle;
  12579.  
  12580. æC 
  12581.  
  12582. æKY GetDCtlEntry
  12583. æFc Devices.h
  12584. æT Function
  12585. æD pascal DCtlHandle GetDCtlEntry(short refNum); 
  12586. æDT DCtlHandle myVariable = GetDCtlEntry((short) refNum);
  12587. æMM
  12588. æRT 71
  12589. æRI II-190
  12590. æC 
  12591.  
  12592. æKY SetChooserAlert
  12593. æFc Devices.h
  12594. æT Function
  12595. æD pascal Boolean SetChooserAlert(Boolean f); 
  12596. æDT Boolean myVariable = SetChooserAlert((Boolean) f);
  12597. æRI V-431
  12598. æC 
  12599. If f is true, the Chooser will put up the page setup alert; if f is false
  12600. it won’t.  SetChooserAlert returns the original alert state.  The 
  12601. application should restore the original alert state when it exits.
  12602. _____________________________________________________________________________________
  12603. Assembly-language note:  If the psAlert bit of the low-memory global
  12604. HiliteMode is 0 then no page setup alert will be generated. 
  12605. Applications that set or clear this bit must be sure not to affect
  12606. any other bits in the byte and to restore the bit as they leave.
  12607.      
  12608. HiliteMode  equ  $938
  12609. psAlert     equ  6
  12610. bclr        #psAlert,HiliteMode
  12611. bset        #psAlert,HiliteMode
  12612. _____________________________________________________________________________________
  12613.  
  12614. æKY OpenDriver
  12615. æFc Devices.h
  12616. æT Function
  12617. æD pascal OSErr OpenDriver(const Str255 name,short *drvrRefNum); 
  12618. æDT OSErr myVariable = OpenDriver((const Str255) name,(short *) drvrRefNum);
  12619. æMM
  12620. æRI II-178, N14-2
  12621. æC 
  12622. [Not in ROM]
  12623.  
  12624. OpenDriver opens the device driver specified by name and returns its reference number
  12625. in refNum.
  12626.  
  12627. Result codes    noErr           No error
  12628.                 badUnitErr      Bad reference number
  12629.                 dInstErr        Couldn’t find driver in resource file
  12630.                 openErr         Driver can’t perform the requested
  12631.                                 reading or writing
  12632.                 unitEmptyErr    Bad reference number
  12633.  
  12634. æKY opendriver
  12635. æFc Devices.h
  12636. æT Function
  12637. æD OSErr opendriver(char *driverName,short *refNum); 
  12638. æDT OSErr myVariable = opendriver((char *) driverName,(short *) refNum);
  12639. æC 
  12640.  
  12641. æKY CloseDriver
  12642. æFc Devices.h
  12643. æT Function
  12644. æD pascal OSErr CloseDriver(short refNum); 
  12645. æDT OSErr myVariable = CloseDriver((short) refNum);
  12646. æRI II-178
  12647. æC 
  12648. [Not in ROM]
  12649.  
  12650. CloseDriver closes the device driver having the reference number refNum. Any pending
  12651. I/O is completed, and the memory used by the driver is released.
  12652.  
  12653. Warning:  Before using this command to close a particular driver, refer
  12654.           to the chapter describing the driver for the consequences of
  12655.           closing it.
  12656.  
  12657. Result codes    noErr           No error
  12658.                 badUnitErr      Bad reference number
  12659.                 dRemoveErr      Attempt to remove an open driver
  12660.                 unitEmptyErr    Bad reference number
  12661.  
  12662. æKY Control
  12663. æFc Devices.h
  12664. æT Function
  12665. æD pascal OSErr Control(short refNum,short csCode,Ptr csParamPtr); 
  12666. æDT OSErr myVariable = Control((short) refNum,(short) csCode,(Ptr) csParamPtr);
  12667. æMM
  12668. æRI II-186
  12669. æC 
  12670. [Not in ROM]
  12671.  
  12672. Control sends control information to the device driver having the reference number
  12673. refNum. The type of information sent is specified by csCode, and the information
  12674. itself is pointed to by csParamPtr. The values passed in csCode and pointed to by
  12675. csParamPtr depend on the driver being called.
  12676.  
  12677. Result codes    noErr           No error
  12678.                 badUnitErr      Bad reference number
  12679.                 notOpenErr      Driver isn’t open
  12680.                 unitEmptyErr    Bad reference number
  12681.                 controlErr      Driver can’t respond to this Control call
  12682.  
  12683. æKY Status
  12684. æFc Devices.h
  12685. æT Function
  12686. æD pascal OSErr Status(short refNum,short csCode,Ptr csParamPtr); 
  12687. æDT OSErr myVariable = Status((short) refNum,(short) csCode,(Ptr) csParamPtr);
  12688. æMM
  12689. æRI II-186
  12690. æC 
  12691. [Not in ROM]
  12692.  
  12693. Status returns status information about the device driver having the reference number
  12694. refNum. The type of information returned is specified by csCode, and the information
  12695. itself is pointed to by csParamPtr. The values passed in csCode and pointed to by
  12696. csParamPtr depend on the driver being called.
  12697.  
  12698. Result codes    noErr           No error
  12699.                 badUnitErr      Bad reference number
  12700.                 notOpenErr      Driver isn’t open
  12701.                 unitEmptyErr    Bad reference number
  12702.                 statusErr       Driver can’t respond to this Status call
  12703.  
  12704. æKY KillIO
  12705. æFc Devices.h
  12706. æT Function
  12707. æD pascal OSErr KillIO(short refNum); 
  12708. æDT OSErr myVariable = KillIO((short) refNum);
  12709. æRI II-179 
  12710. æC 
  12711. [Not in ROM]
  12712.  
  12713. KillIO terminates all current and pending I/O with the device driver having the
  12714. reference number refNum.
  12715.  
  12716. Result codes    noErr           No error
  12717.                 badUnitErr      Bad reference number
  12718.  
  12719. æKY PBControl
  12720. æFc Devices.h
  12721. æT Function
  12722. æD pascal OSErr PBControl(ParmBlkPtr paramBlock,Boolean aSync); 
  12723. æDT OSErr myVariable = PBControl((ParmBlkPtr) paramBlock,(Boolean) aSync);
  12724. æMM
  12725. æRI II-186
  12726. æC 
  12727. Trap macro    _Control
  12728.  
  12729. Parameter block
  12730.   -->    12    ioCompletion  pointer
  12731.   <--    16    ioResult      word
  12732.   -->    22    ioVRefNum     word
  12733.   -->    24    ioRefNum      word
  12734.   -->    26    csCode        word
  12735.   -->    28    csParam       record
  12736.  
  12737. PBControl sends control information to the device driver having the reference number
  12738. ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of information
  12739. sent is specified by csCode, and the information itself begins at csParam. The values
  12740. passed in csCode and csParam depend on the driver being called.
  12741.  
  12742. Result codes    noErr           No error
  12743.                 badUnitErr      Bad reference number
  12744.                 notOpenErr      Driver isn’t open
  12745.                 unitEmptyErr    Bad reference number
  12746.                 controlErr      Driver can’t respond to this Control call
  12747.  
  12748. æKY PBStatus
  12749. æFc Devices.h
  12750. æT Function
  12751. æD pascal OSErr PBStatus(ParmBlkPtr paramBlock,Boolean aSync); 
  12752. æDT OSErr myVariable = PBStatus((ParmBlkPtr) paramBlock,(Boolean) aSync);
  12753. æMM
  12754. æRI II-186
  12755. æC 
  12756. Trap macro    _Status
  12757.  
  12758. Parameter block
  12759.   -->    12    ioCompletion  pointer
  12760.   <--    16    ioResult      word
  12761.   -->    22    ioVRefNum     word
  12762.   -->    24    ioRefNum      word
  12763.   -->    26    csCode        word
  12764.   <--    28    csParam       record
  12765.  
  12766. PBStatus returns status information about the device driver having the reference
  12767. number ioRefNum; the drive number, if any, is specified by ioVRefNum. The type of
  12768. information returned is specified by csCode, and the information itself begins at
  12769. csParam. The values passed in csCode and csParam depend on the driver being called.
  12770.  
  12771. Result codes    noErr           No error
  12772.                 badUnitErr      Bad reference number
  12773.                 notOpenErr      Driver isn’t open
  12774.                 unitEmptyErr    Bad reference number
  12775.                 statusErr       Driver can’t respond to this Status call
  12776.  
  12777. æKY PBKillIO
  12778. æFc Devices.h
  12779. æT Function
  12780. æD pascal OSErr PBKillIO(ParmBlkPtr paramBlock,Boolean aSync); 
  12781. æDT OSErr myVariable = PBKillIO((ParmBlkPtr) paramBlock,(Boolean) aSync);
  12782. æRI II-187
  12783. æC 
  12784. Trap macro    _KillIO
  12785.  
  12786. Parameter block
  12787.   -->    12    ioCompletion  pointer
  12788.   <--    16    ioResult      word
  12789.   -->    24    ioRefNum      word
  12790.  
  12791. PBKillIO stops any current I/O request being processed, and removes all pending I/O
  12792. requests from the I/O queue of the device driver having the reference number ioRefNum.
  12793. The completion routine of each pending I/O request is called, with the ioResult field
  12794. of each request equal to the result code abortErr.
  12795.  
  12796. Result codes    noErr           No error
  12797.                 badUnitErr      Bad reference number
  12798.                 unitEmptyErr    Bad reference number
  12799.  
  12800.  
  12801. æKY Dialogs.h
  12802. æKL Alert
  12803. CautionAlert
  12804. CloseDialog
  12805. CouldAlert
  12806. CouldDialog
  12807. DialogSelect
  12808. DisposDialog
  12809. DlgCopy
  12810. DlgCut
  12811. DlgDelete
  12812. DlgPaste
  12813. DrawDialog
  12814. ErrorSound
  12815. findditem
  12816. FindDItem
  12817. FreeAlert
  12818. FreeDialog
  12819. GetAlrtStage
  12820. GetDItem
  12821. getitext
  12822. GetIText
  12823. GetNewDialog
  12824. HideDItem
  12825. InitDialogs
  12826. IsDialogEvent
  12827. ModalDialog
  12828. newcdialog
  12829. NewCDialog
  12830. newdialog
  12831. NewDialog
  12832. NoteAlert
  12833. paramtext
  12834. ParamText
  12835. ResetAlrtStage
  12836. SelIText
  12837. SetDAFont
  12838. SetDItem
  12839. setitext
  12840. SetIText
  12841. ShowDItem
  12842. StopAlert
  12843. UpdtDialog
  12844.  
  12845. AlertTemplate
  12846. AlertTHndl
  12847. AlertTPtr
  12848. btnCtrl
  12849. cancel
  12850. cautionIcon
  12851. chkCtrl
  12852. ctrlItem
  12853. DialogPeek
  12854. DialogPtr
  12855. DialogRecord
  12856. DialogTemplate
  12857. DialogTHndl
  12858. DialogTPtr
  12859. editText
  12860. iconItem
  12861. itemDisable
  12862. noteIcon
  12863. ok
  12864. picItem
  12865. radCtrl
  12866. resCtrl
  12867. ResumeProcPtr
  12868. SoundProcPtr
  12869. StageList
  12870. statText
  12871. stopIcon
  12872. userItem
  12873.  
  12874. æKY ctrlItem
  12875. æFc Dialogs.h
  12876. æT #define
  12877. æD #define ctrlItem 4
  12878. æC 
  12879.  
  12880. æKY btnCtrl
  12881. æFc Dialogs.h
  12882. æT #define
  12883. æD #define btnCtrl 0
  12884. æC 
  12885.  
  12886. æKY chkCtrl
  12887. æFc Dialogs.h
  12888. æT #define
  12889. æD #define chkCtrl 1
  12890. æC 
  12891.  
  12892. æKY radCtrl
  12893. æFc Dialogs.h
  12894. æT #define
  12895. æD #define radCtrl 2
  12896. æC 
  12897.  
  12898. æKY resCtrl
  12899. æFc Dialogs.h
  12900. æT #define
  12901. æD #define resCtrl 3
  12902. æC 
  12903.  
  12904. æKY statText
  12905. æFc Dialogs.h
  12906. æT #define
  12907. æD #define statText 8
  12908. æC 
  12909.  
  12910. æKY editText
  12911. æFc Dialogs.h
  12912. æT #define
  12913. æD #define editText 16
  12914. æC 
  12915.  
  12916. æKY iconItem
  12917. æFc Dialogs.h
  12918. æT #define
  12919. æD #define iconItem 32
  12920. æC 
  12921.  
  12922. æKY picItem
  12923. æFc Dialogs.h
  12924. æT #define
  12925. æD #define picItem 64
  12926. æC 
  12927.  
  12928. æKY userItem
  12929. æFc Dialogs.h
  12930. æT #define
  12931. æD #define userItem 0
  12932. æC 
  12933.  
  12934. æKY itemDisable
  12935. æFc Dialogs.h
  12936. æT #define
  12937. æD #define itemDisable 128
  12938. æC 
  12939.  
  12940. æKY ok
  12941. æFc Dialogs.h
  12942. æT #define
  12943. æD #define ok 1
  12944. æC 
  12945.  
  12946. æKY cancel
  12947. æFc Dialogs.h
  12948. æT #define
  12949. æD #define cancel 2
  12950. æC 
  12951.  
  12952. æKY stopIcon
  12953. æFc Dialogs.h
  12954. æT #define
  12955. æD #define stopIcon 0
  12956. æC 
  12957.  
  12958. æKY noteIcon
  12959. æFc Dialogs.h
  12960. æT #define
  12961. æD #define noteIcon 1
  12962. æC 
  12963.  
  12964. æKY cautionIcon
  12965. æFc Dialogs.h
  12966. æT #define
  12967. æD #define cautionIcon 2
  12968. æC 
  12969.  
  12970. æKY StageList
  12971. æFc Dialogs.h
  12972. æT typedef
  12973. æD typedef short StageList;
  12974. æC »Alert Templates in Memory
  12975.  
  12976. The data structure of an alert template is as follows:
  12977.  
  12978. TYPE AlertTemplate = RECORD
  12979.                        boundsRect:  Rect;      {becomes window's portRect}
  12980.                        itemsID:     INTEGER;   {resource ID of item list}
  12981.                        stages:      StageList  {alert stage information}
  12982.                      END;
  12983.  
  12984. BoundsRect is the rectangle that becomes the portRect of the window's grafPort. The
  12985. itemsID field contains the resource ID of the item list for the alert.
  12986.  
  12987. The information in the stages field determines exactly what should happen at each
  12988. stage of the alert. It's packed into a word that has the following structure:
  12989.  
  12990. TYPE StageList = PACKED RECORD
  12991.                    boldItm4:  0..1;     {default button item number minus 1}
  12992.                    boxDrwn4:  BOOLEAN;  {TRUE if alert box to be drawn}
  12993.                    sound4:    0..3      {sound number}
  12994.                    boldItm3:  0..1; 
  12995.                    boxDrwn3:  BOOLEAN; 
  12996.                    sound3:    0..3 
  12997.                    boldItm2:  0..1; 
  12998.                    boxDrwn2:  BOOLEAN; 
  12999.                    sound2:    0..3 
  13000.                    boldItm1:  0..1; 
  13001.                    boxDrwn1:  BOOLEAN; 
  13002.                    sound1:    0..3 
  13003.                  END;
  13004.  
  13005. Notice that the information is stored in reverse order—for the fourth stage first,
  13006. and for the first stage last.
  13007.  
  13008. The boldItm field indicates which button should be the default button (and therefore
  13009. boldly outlined in the alert box). If the first two items in the alert’s item list
  13010. are the OK button and the Cancel button, respectively, 0 will refer to the OK button
  13011. and 1 to the Cancel button. The reason for this is that the value of boldItm plus 1
  13012. is interpreted as an item number, and normally items 1 and 2 are the OK and Cancel
  13013. buttons, respectively. Whatever the item having the corresponding item number happens
  13014. to be, a bold rounded-corner rectangle will be drawn outside its display rectangle.
  13015.  
  13016. Note:  When deciding where to place items in an alert box, be sure to allow
  13017.        room for any bold outlines that may be drawn.
  13018.  
  13019. The boxDrwn field is TRUE if the alert box is to be drawn.
  13020.  
  13021. The sound field specifies which sound should be emitted at this stage of the alert,
  13022. with a number from 0 to 3 that’s passed to the current sound procedure. You can call
  13023. ErrorSound to specify your own sound procedure; if you don’t, the standard sound
  13024. procedure will be used (as described earlier in the “Alerts” section).
  13025.  
  13026. You access the alert template by converting the handle returned by the Resource
  13027. Manager to a template handle:
  13028.  
  13029. TYPE  AlertTHndl = ^AlertTPtr;
  13030.       AlertTPtr  = ^AlertTemplate;
  13031.  
  13032. Assembly-language note:  Rather than offsets into the fields of the StageList
  13033.                          data structure, there are masks for accessing the
  13034.                          information stored for an alert stage in a stages
  13035.                          word; they’re listed in the summary at the end of
  13036.                          this chapter.
  13037.  
  13038. æKY DialogPtr
  13039. æFc Dialogs.h
  13040. æT typedef
  13041. æD typedef WindowPtr DialogPtr;
  13042. æC 
  13043. »Dialog Pointers
  13044.  
  13045. There are two types of dialog pointer, DialogPtr and DialogPeek, analogous to the
  13046. window pointer types WindowPtr and WindowPeek. Most programmers will only need to use
  13047. DialogPtr.
  13048.  
  13049. The Dialog Manager defines the following type of dialog pointer:
  13050.  
  13051. TYPE  DialogPtr = WindowPtr;
  13052.  
  13053. It can do this because the first field of a dialog record contains the window record
  13054. for the dialog window. This type of pointer can be used to access fields of the
  13055. window record or can be passed to Window Manager routines that expect window pointers
  13056. as parameters. Since the WindowPtr data type is itself defined as GrafPtr, this type
  13057. of dialog pointer can also be used to access fields of the dialog window’s grafPort
  13058. or passed to QuickDraw routines that expect pointers to grafPorts as parameters.
  13059.  
  13060. For programmers who want to access dialog record fields beyond the window record, the
  13061. Dialog Manager also defines the following type of dialog pointer:
  13062.  
  13063. TYPE  DialogPeek = ^DialogRecord;
  13064.  
  13065. Assembly-language note:  From assembly language, of course, there’s no
  13066.                          type checking on pointers, and the two types
  13067.                          of pointer are equal.
  13068.  
  13069. _______________________________________________________________________________
  13070.  
  13071. »The DialogRecord Data Type
  13072.  
  13073. For those who want to know more about the data structure of a dialog record, the
  13074. exact structure is given here.
  13075.  
  13076. TYPE  DialogRecord = RECORD
  13077.                        window:     WindowRecord;  {dialog window}
  13078.                        items:      Handle;        {item list}
  13079.                        textH:      TEHandle;      {current editText item}
  13080.                        editField:  INTEGER;       {editText item number minus 1}
  13081.                        editOpen:   INTEGER;       {used internally}
  13082.                        aDefItem:   INTEGER        {default button item number}
  13083.                      END;
  13084.  
  13085. The window field contains the window record for the dialog window. The items field
  13086. contains a handle to the item list used for the dialog. (Remember that after reading
  13087. an item list from a resource file, the Dialog Manager makes a copy of it and uses
  13088. that copy.)
  13089.  
  13090. Note:  To get or change information about an item in a dialog, you pass the
  13091.        dialog pointer and the item number to a Dialog Manager procedure.
  13092.        You’ll never access information directly through the handle to the
  13093.        item list.
  13094.  
  13095. The Dialog Manager uses the next three fields when there are one or more editText
  13096. items in the dialog. If there’s more than one such item, these fields apply to the
  13097. one that currently is selected or displays the insertion point. The textH field
  13098. contains the handle to the edit record used by TextEdit. EditField is 1 less than the
  13099. item number of the current editText item, or –1 if there’s no editText item in the
  13100. dialog. The editOpen field is used internally by the Dialog Manager.
  13101.  
  13102. Note:  Actually, a single edit record is shared by all editText items; any
  13103.        changes you make to it will apply to all such items. See the TextEdit
  13104.        chapter for details about what kinds of changes you can make.
  13105.  
  13106. The aDefItem field is used for modal dialogs and alerts, which are treated internally
  13107. as special modal dialogs. It contains the item number of the default button. The
  13108. default button for a modal dialog is the first item in the item list, so this field
  13109. contains 1 for modal dialogs. The default button for an alert is specified in the
  13110. alert template; see the following section for more information.
  13111.  
  13112. _______________________________________________________________________________
  13113.  
  13114. »THE DRAWING ENVIRONMENT:  GRAFPORT
  13115. _______________________________________________________________________________
  13116.  
  13117. A grafPort is a complete drawing environment that defines where and how graphic
  13118. operations will take place. You can have many grafPorts open at once, and each one
  13119. will have its own coordinate system, drawing pattern, background pattern, pen size
  13120. and location, character font and style, and bit map in which drawing takes place. You
  13121. can instantly switch from one port to another. GrafPorts are the structures upon
  13122. which a program builds windows, which are fundamental to the Macintosh “overlapping
  13123. windows” user interface. Besides being used for windows on the screen, grafPorts are
  13124. used for printing and for off-screen drawing.
  13125.  
  13126. A grafPort is defined as follows:
  13127.  
  13128. TYPE  GrafPtr   =  ^GrafPort;
  13129.       GrafPort  =  RECORD
  13130.                      device:      INTEGER;    {device-specific information}
  13131.                      portBits:    BitMap;     {grafPort's bit map}
  13132.                      portRect:    Rect;       {grafPort's rectangle}
  13133.                      visRgn:      RgnHandle;  {visible region}
  13134.                      clipRgn:     RgnHandle;  {clipping region}
  13135.                      bkPat:       Pattern;    {background pattern}
  13136.                      fillPat:     Pattern;    {fill pattern}
  13137.                      pnLoc:       Point;      {pen location}
  13138.                      pnSize:      Point;      {pen size}
  13139.                      pnMode:      INTEGER;    {pen's transfer mode}
  13140.                      pnPat:       Pattern;    {pen pattern}
  13141.                      pnVis:       INTEGER;    {pen visibility}
  13142.                      txFont:      INTEGER;    {font number for text}
  13143.                      txFace:      Style;      {text's character style}
  13144.                      txMode:      INTEGER;    {text's transfer mode}
  13145.                      txSize:      INTEGER;    {font size for text}
  13146.                      spExtra:     Fixed;      {extra space}
  13147.                      fgColor:     LONGINT;    {foreground color}
  13148.                      bkColor:     LONGINT;    {background color}
  13149.                      colrBit:     INTEGER;    {color bit}
  13150.                      patStretch:  INTEGER;    {used internally}
  13151.                      picSave:     Handle;     {picture being saved}
  13152.                      rgnSave:     Handle;     {region being saved}
  13153.                      polySave:    Handle;     {polygon being saved}
  13154.                      grafProcs:   QDProcsPtr  {low-level drawing routines}
  13155.                    END;
  13156.  
  13157. Note that picSave is a Handle used internally by QuickDraw while it is saving a
  13158. picture, and rgnSave and polySave are used by QuickDraw as flags; they are set to “1”
  13159. when the corresponding action is taking place.
  13160.  
  13161. All QuickDraw operations refer to grafPorts via grafPtrs. (For historical reasons,
  13162. grafPort is one of the few objects in the Macintosh system software that’s referred
  13163. to by a pointer rather than a handle.)
  13164.  
  13165. Warning:  You can access all fields and subfields of a grafPort normally,
  13166.           but you should not store new values directly into them. QuickDraw
  13167.           has routines for altering all fields of a grafPort, and using
  13168.           these routines ensures that changing a grafPort produces no
  13169.           unusual side effects.
  13170.  
  13171. The device field of a grafPort contains device-specific information that’s used by
  13172. the Font Manager to achieve the best possible results when drawing text in the grafPort.
  13173. There may be physical differences in the same logical font for different output
  13174. devices, to ensure the highest-quality printing on the device being used. The default
  13175. value of the device field is 0, for best results on output to the screen. For more
  13176. information, see the Font Manager chapter.
  13177.  
  13178. The portBits field is the bit map that points to the bit image to be used by the
  13179. grafPort. The default bit map uses the entire screen as its bit image. The bit map
  13180. may be changed to indicate a different structure in memory:  All graphics routines
  13181. work in exactly the same way regardless of whether their effects are visible on the
  13182. screen. A program can, for example, prepare an image to be printed on a printer
  13183. without ever displaying the image on the screen, or develop a picture in an off-screen
  13184. bit map before transferring it to the screen. The portBits.bounds rectangle determines
  13185. the coordinate system of the grafPort; all other coordinates in the grafPort are
  13186. expressed in this system.
  13187.  
  13188. The portRect field is a rectangle that defines a subset of the bit map that will be
  13189. used for drawing:  All drawing done by the application occurs inside the portRect.
  13190. Its coordinates are in the coordinate system defined by the portBits.bounds rectangle.
  13191. The portRect usually falls within the portBits.bounds rectangle, but it’s not required
  13192. to do so. The portRect usually defines the “writable” interior area of a window,
  13193. document, or other object on the screen.
  13194.  
  13195. The visRgn field is manipulated by the Window Manager; you will normally never change
  13196. a grafPort’s visRgn. It indicates the region of the grafPort that’s actually visible
  13197. on the screen, that is, the part of the window that’s not covered by other windows.
  13198. For example, if you move one window in front of another, the Window Manager logically
  13199. removes the area of overlap from the visRgn of the window in back. When you draw into
  13200. the back window, whatever’s being drawn is clipped to the visRgn so that it doesn’t
  13201. run over onto the front window. The default visRgn is set to the portRect.
  13202.  
  13203. The clipRgn is the grafPort’s clipping region, an arbitrary region that you can use
  13204. to limit drawing to any region within the portRect. If, for example, you want to draw
  13205. a half circle on the screen, you can set the clipRgn to half the square that would
  13206. enclose the whole circle, and then draw the whole circle. Only the half within the
  13207. clipRgn will actually be drawn in the grafPort. The default clipRgn is set arbitrarily
  13208. large, you have full control over its setting; as a matter of recommended programming
  13209. practice, it is advisable to make the default clipRgn rectangle smaller.
  13210.  
  13211. Figure 10 illustrates a typical bit map (as defined by portBits), portRect, visRgn,
  13212. and clipRgn.
  13213.  
  13214. •••Refer to Figure 10.•••
  13215.  
  13216. Figure 10–GrafPort Regions
  13217.  
  13218. The bkPat and fillPat fields of a grafPort contain patterns used by certain QuickDraw
  13219. routines. BkPat is the “background” pattern that’s used when an area is erased or
  13220. when bits are scrolled out of it. When asked to fill an area with a specified pattern,
  13221. QuickDraw stores the given pattern in the fillPat field and then calls a low-level
  13222. drawing routine that gets the pattern from that field. The various graphic operations
  13223. are discussed in detail later in the descriptions of individual QuickDraw routines.
  13224.  
  13225. Of the next ten fields, the first five determine characteristics of the graphics pen
  13226. and the last five determine characteristics of any text that may be drawn; these are
  13227. described in separate sections below.
  13228.  
  13229. The fgColor, bkColor, and colrBit fields contain values related to drawing in color.
  13230. FgColor is the grafPort’s foreground color and bkColor is its background color.
  13231. ColrBit tells the color imaging software which plane of the color picture to draw
  13232. into. For more information, see “Drawing in Color” in the section “General Discussion
  13233. of Drawing”.
  13234.  
  13235. The patStretch field is used during output to a printer to expand patterns if necessary.
  13236. The application should not change its value.
  13237.  
  13238. The picSave, rgnSave, and polySave fields reflect the state of picture, region, and
  13239. polygon definition, respectively. The application shouldn’t be concerned about exactly
  13240. what information the handle, if any, leads to; you may, however, save the current
  13241. value of rgnSave, set the field to NIL to disable the region definition, and later
  13242. restore it to the saved value to resume the region definition. The picSave and polySave
  13243. fields work similarly for pictures and polygons.
  13244.  
  13245. Finally, the grafProcs field may point to a special data structure that the application
  13246. stores into if it wants to customize QuickDraw drawing routines or use QuickDraw in
  13247. other advanced, highly specialized ways (see “Customizing QuickDraw Operations”). If
  13248. grafProcs is NIL, QuickDraw responds in the standard ways described in this chapter.
  13249.  
  13250. _______________________________________________________________________________
  13251.  
  13252. »Pen Characteristics
  13253.  
  13254. The pnLoc, pnSize, pnMode, pnPat, and pnVis fields of a grafPort deal with the graphics
  13255. “pen”. Each grafPort has one and only one such pen, which is used for drawing lines,
  13256. shapes, and text. The pen has four characteristics:  a location, a size (height and
  13257. width), a drawing mode, and a drawing pattern (see Figure
  13258. 11).
  13259.  
  13260. •••Refer to Figure 11.•••
  13261.  
  13262. Figure 11–A Graphics Pen
  13263.  
  13264. The pnLoc field specifies the point where QuickDraw will begin drawing the next line,
  13265. shape, or character. It can be anywhere on the coordinate plane:  There are no restrictions
  13266. on the movement or placement of the pen. Remember that the pen location is a point in
  13267. the grafPort’s coordinate system, not a pixel in a bit image. The top left corner of
  13268. the pen is at the pen location; the pen hangs below and to the right of this point.
  13269.  
  13270. The pen is rectangular in shape, and its width and height are specified by pnSize.
  13271. The default size is a 1-by-1-bit square; the width and height can range from (0,0) to
  13272. (30000,30000). If either the pen width or the pen height is less than 1, the pen will
  13273. not draw.
  13274.  
  13275. The pnMode and pnPat fields of a grafPort determine how the bits under the pen are
  13276. affected when lines or shapes are drawn. The pnPat is a pattern that’s used like the
  13277. “ink” in the pen. This pattern, like all other patterns drawn in the grafPort, is
  13278. always aligned with the port’s coordinate system:  The top left corner of the pattern
  13279. is aligned with the top left corner of the portRect, so that adjacent areas of the
  13280. same pattern will blend into a continuous, coordinated pattern.
  13281.  
  13282. The pnMode field determines how the pen pattern is to affect what’s already in the
  13283. bit image when lines or shapes are drawn. When the pen draws, QuickDraw first determines
  13284. what bits in the bit image will be affected and finds their corresponding bits in the
  13285. pattern. It then does a bit-by-bit comparison based on the pen mode, which specifies
  13286. one of eight Boolean operations to perform. The resulting bit is stored into its
  13287. proper place in the bit image. The pen modes are described under “Transfer Modes” in
  13288. the section “General Discussion of Drawing”.
  13289.  
  13290. The pnVis field determines the pen’s visibility, that is, whether it draws on the
  13291. screen. For more information, see the descriptions of HidePen and ShowPen under “Pen
  13292. and Line-Drawing Routines” in the “QuickDraw Routines” section.
  13293.  
  13294. _______________________________________________________________________________
  13295.  
  13296. »Text Characteristics
  13297.  
  13298. The txFont, txFace, txMode, txSize, and spExtra fields of a grafPort determine how
  13299. text will be drawn—the font, style, and size of characters and how they will be
  13300. placed in the bit image. QuickDraw can draw characters as quickly and easily as it
  13301. draws lines and shapes, and in many prepared fonts. Font means the complete set of
  13302. characters of one typeface. The characters may be drawn in any size and character
  13303. style (that is, with stylistic variations such as bold, italic, and underline).
  13304. Figure 12 shows two characters drawn by QuickDraw and some terms associated with
  13305. drawing text.
  13306.  
  13307. •••Refer to Figure 12.•••
  13308.  
  13309. Figure 12–QuickDraw Characters
  13310.  
  13311. Text is drawn with the base line positioned at the pen location.
  13312.  
  13313. The txFont field is a font number that identifies the character font to be used in
  13314. the grafPort. The font number 0 represents the system font. For more information
  13315. about the system font, the other font numbers recognized by the Font Manager, and the
  13316. construction, layout, and loading of fonts, see the Font Manager chapter.
  13317.  
  13318. A character font is defined as a collection of images that make up the individual
  13319. characters of the font. The characters can be of unequal widths, and they’re not
  13320. restricted to their “cells”:  The lower curl of a lowercase j, for example, can
  13321. stretch back under the previous character (typographers call this kerning). A font
  13322. can consist of up to 255 distinct characters, yet not all characters need to be
  13323. defined in a single font. In addition, each font contains a missing symbol to be
  13324. drawn in case of a request to draw a character that’s missing from the font.
  13325.  
  13326. The txFace field controls the character style of the text with values from the set
  13327. defined by the Style data type:
  13328.  
  13329. TYPE  StyleItem  = (bold,italic,underline,outline,shadow,condense,extend);
  13330.       Style      = SET OF StyleItem;
  13331.  
  13332. Assembly-language note:  In assembly language, this set is stored as a word
  13333.                          whose low-order byte contains bits representing the
  13334.                          style. The bit numbers are specified by the following
  13335.                          global constants:
  13336.  
  13337.                            boldBit       .EQU    0
  13338.                            italicBit     .EQU    1
  13339.                            ulineBit      .EQU    2
  13340.                            outlineBit    .EQU    3
  13341.                            shadowBit     .EQU    5
  13342.                            extendBit     .EQU    6
  13343.  
  13344.                          If all bits are 0, it represents the plain character
  13345.                          style.
  13346.  
  13347. You can apply stylistic variations either alone or in combination; Figure 13 illustrates
  13348. some as applied to the Geneva font. Most combinations usually look good only for
  13349. large font sizes.
  13350.  
  13351. •••Refer to Figure 13.•••
  13352.  
  13353. Figure 13–Stylistic Variations
  13354.  
  13355. If you specify bold, each character is repeatedly drawn one bit to the right an
  13356. appropriate number of times for extra thickness.
  13357.  
  13358. Italic adds an italic slant to the characters. Character bits above the base line are
  13359. skewed right; bits below the base line are skewed left.
  13360.  
  13361. Underline draws a line below the base line of the characters. If part of a character
  13362. descends below the base line (as “y” in Figure 13), the underline
  13363. isn’t drawn through the pixel on either side of the descending part.
  13364.  
  13365. Outline makes a hollow, outlined character rather than a solid one. Shadow also makes
  13366. an outlined character, but the outline is thickened below and to the right of the
  13367. character to achieve the effect of a shadow. If you specify bold along with outline
  13368. or shadow, the hollow part of the character is widened.
  13369.  
  13370. Condense and extend affect the horizontal distance between all characters, including
  13371. spaces. Condense decreases the distance between characters and extend increases it,
  13372. by an amount that the Font Manager determines is appropriate.
  13373.  
  13374. The txMode field controls the way characters are placed in the bit image. It functions
  13375. much like a pnMode:  When a character is drawn, QuickDraw determines which bits in
  13376. the bit image will be affected, does a bit-by-bit comparison based on the mode, and
  13377. stores the resulting bits into the bit image. These modes are described under “Transfer
  13378. Modes” in the section “General Discussion of Drawing”. Only three of them—srcOr,
  13379. srcXor, and srcBic—should be used for drawing text.
  13380.  
  13381. Note:  If you use scrCopy, some extra blank space will be appended at the
  13382.        end of the text.
  13383.  
  13384. The txSize field specifies the font size in points (where “point” is a typographical
  13385. term meaning approximately 1/72 inch). Any size from 1 to 127 points may be specified.
  13386. If the Font Manager doesn’t have the font in a specified size, it will scale a size
  13387. it does have as necessary to produce the size desired. A value of 0 in this field
  13388. represents the system font size (12 points).
  13389.  
  13390. Finally, the spExtra field is useful when a line of characters is to be drawn justified
  13391. such that it’s aligned with both a left and a right margin (sometimes called “full
  13392. justification”). SpExtra contains a fixed-point number equal to the average number of
  13393. pixels by which each space character should be widened to fill out the line. The
  13394. Fixed data type is described in the Macintosh Memory Management:  An Introduction
  13395. chapter.
  13396.  
  13397. _______________________________________________________________________________
  13398.  
  13399. »COORDINATES IN GRAFPORTS
  13400. _______________________________________________________________________________
  13401.  
  13402. Each grafPort has its own local coordinate system. All fields in the grafPort are
  13403. expressed in these coordinates, and all calculations and actions performed in QuickDraw
  13404. use the local coordinate system of the currently selected port.
  13405.  
  13406. Two things are important to remember:
  13407.  
  13408.   •  Each grafPort maps a portion of the coordinate plane into a similarly-
  13409.      sized portion of a bit image.
  13410.   •  The portBits.bounds rectangle defines the local coordinates for a grafPort.
  13411.  
  13412. The top left corner of portBits.bounds is always aligned around the first bit in the
  13413. bit image; the coordinates of that corner “anchor” a point on the grid to that bit in
  13414. the bit image. This forms a common reference point for multiple grafPorts that use
  13415. the same bit image (such as the screen); given a portBits.bounds rectangle for each
  13416. port, you know that their top left corners coincide.
  13417.  
  13418. The relationship between the portBits.bounds and portRect rectangles is very important:
  13419.  The portBits.bounds rectangle establishes a coordinate system for the port, and the
  13420. portRect rectangle indicates the section of the coordinate plane (and thus the bit
  13421. image) that will be used for drawing. The portRect usually falls inside the portBits.bounds
  13422. rectangle, but it’s not required to do so.
  13423.  
  13424. When a new grafPort is created, its bit map is set to point to the entire screen, and
  13425. both the portBits.bounds and the portRect are set to rectangles enclosing the screen.
  13426. The point (0,0) corresponds to the screen’s top left corner.
  13427.  
  13428. You can redefine the local coordinates of the top left corner of the grafPort’s
  13429. portRect, using the SetOrigin procedure. This offsets the coordinates of the grafPort’s
  13430. portBits.bounds rectangle, recalculating the coordinates of all points in the grafPort
  13431. to be relative to the new corner coordinates. For example, consider these procedure
  13432. calls:
  13433.  
  13434.   SetPort(gamePort);
  13435.   SetOrigin(90,80)
  13436.  
  13437. The call to SetPort sets the current grafPort to gamePort; the call to SetOrigin
  13438. changes the local coordinates of the top left corner of that port’s portRect to
  13439. (90,80) (see Figure 14).
  13440.  
  13441. •••Refer to Figure 14.•••
  13442.  
  13443. Figure 14–Changing Local Coordinates
  13444.  
  13445. This offsets the coordinates of the following elements:
  13446.  
  13447.   gamePort^.portBits.bounds
  13448.   gamePort^.portRect
  13449.   gamePort^.visRgn
  13450.  
  13451. These three elements are always kept “in sync”.
  13452.  
  13453. Notice that when the local coordinates of a grafPort are offset, the grafPort’s
  13454. clipRgn and pen location are not offset. A good way to think of it is that the port’s
  13455. structure “sticks” to the screen, while the document in the grafPort
  13456. (along with the pen and clipRgn) “sticks” to the coordinate system. For example, in
  13457. Figure 14, before SetOrigin, the visRgn and clipRgn are the same as the portRect.
  13458. After the SetOrigin call, the locations of portBits.bounds, portRect, and visRgn do
  13459. not change on the screen; their coordinates are simply offset. As always, the top
  13460. left corner of portBits.bounds remains “anchored” around the first bit in the bit
  13461. image (the first pixel on the screen); the image on the screen doesn’t move as a
  13462. result of SetOrigin. However, the pen location and clipRgn do move on the screen; the
  13463. top left corner of the clipRgn is still
  13464. (100,100), but this location has moved down and to the right, and the pen has similarly
  13465. moved.
  13466.  
  13467. If you’re moving, comparing, or otherwise dealing with mathematical items in different
  13468. grafPorts (for example, finding the intersection of two regions in two different
  13469. grafPorts), you must adjust to a common coordinate system before you perform the
  13470. operation. A QuickDraw procedure, LocalToGlobal, lets you convert a point’s local
  13471. coordinates to a global coordinate system where the top left corner of the bit image
  13472. is (0,0); by converting the various local coordinates to global coordinates, you can
  13473. compare and mix them with confidence. For more information, see the description of
  13474. LocaltoGlobal under “Calculations with Points” in the “QuickDraw Routines” section.
  13475.  
  13476. æKY ResumeProcPtr
  13477. æFc Dialogs.h
  13478. æT typedef
  13479. æD typedef pascal void (*ResumeProcPtr)(void);
  13480. æC 
  13481.  
  13482. æKY SoundProcPtr
  13483. æFc Dialogs.h
  13484. æT typedef
  13485. æD typedef pascal void (*SoundProcPtr)(void);
  13486. æC 
  13487.  
  13488. æKY DialogRecord
  13489. DialogPeek
  13490. æFc Dialogs.h
  13491. æT struct
  13492. æD struct DialogRecord {
  13493.     WindowRecord window;
  13494.     Handle items;
  13495.     TEHandle textH;
  13496.     short editField;
  13497.     short editOpen;
  13498.     short aDefItem;
  13499. };
  13500.  
  13501. typedef struct DialogRecord DialogRecord;
  13502. typedef DialogRecord *DialogPeek;
  13503.  
  13504. æC 
  13505.  
  13506. »The DialogRecord Data Type
  13507.  
  13508. For those who want to know more about the data structure of a dialog record, the
  13509. exact structure is given here.
  13510.  
  13511. TYPE  DialogRecord = RECORD
  13512.                        window:     WindowRecord;  {dialog window}
  13513.                        items:      Handle;        {item list}
  13514.                        textH:      TEHandle;      {current editText item}
  13515.                        editField:  INTEGER;       {editText item number minus 1}
  13516.                        editOpen:   INTEGER;       {used internally}
  13517.                        aDefItem:   INTEGER        {default button item number}
  13518.                      END;
  13519.  
  13520. The window field contains the window record for the dialog window. The items field
  13521. contains a handle to the item list used for the dialog. (Remember that after reading
  13522. an item list from a resource file, the Dialog Manager makes a copy of it and uses
  13523. that copy.)
  13524.  
  13525. Note:  To get or change information about an item in a dialog, you pass the
  13526.        dialog pointer and the item number to a Dialog Manager procedure.
  13527.        You’ll never access information directly through the handle to the
  13528.        item list.
  13529.  
  13530. The Dialog Manager uses the next three fields when there are one or more editText
  13531. items in the dialog. If there’s more than one such item, these fields apply to the
  13532. one that currently is selected or displays the insertion point. The textH field
  13533. contains the handle to the edit record used by TextEdit. EditField is 1 less than the
  13534. item number of the current editText item, or –1 if there’s no editText item in the
  13535. dialog. The editOpen field is used internally by the Dialog Manager.
  13536.  
  13537. Note:  Actually, a single edit record is shared by all editText items; any
  13538.        changes you make to it will apply to all such items. See the TextEdit
  13539.        chapter for details about what kinds of changes you can make.
  13540.  
  13541. The aDefItem field is used for modal dialogs and alerts, which are treated internally
  13542. as special modal dialogs. It contains the item number of the default button. The
  13543. default button for a modal dialog is the first item in the item list, so this field
  13544. contains 1 for modal dialogs. The default button for an alert is specified in the
  13545. alert template; see the following section for more information.
  13546.  
  13547. æKY DialogTemplate
  13548. DialogTPtr
  13549. DialogTHndl
  13550. æFc Dialogs.h
  13551. æT struct
  13552. æD struct DialogTemplate {
  13553.     Rect boundsRect;
  13554.     short procID;
  13555.     Boolean visible;
  13556.     Boolean filler1;
  13557.     Boolean goAwayFlag;
  13558.     Boolean filler2;
  13559.     long refCon;
  13560.     short itemsID;
  13561.     Str255 title;
  13562. };
  13563.  
  13564. typedef struct DialogTemplate DialogTemplate;
  13565. typedef DialogTemplate *DialogTPtr, **DialogTHndl;
  13566.  
  13567. æC 
  13568. »Dialog Templates in Memory
  13569.  
  13570. The data structure of a dialog template is as follows:
  13571.  
  13572. TYPE DialogTemplate = RECORD
  13573.                         boundsRect:  Rect;     {becomes window's portRect}
  13574.                         procID:      INTEGER;  {window definiton ID}
  13575.                         visible:     BOOLEAN;  {TRUE if visible}
  13576.                         filler1:     BOOLEAN;  {not used}
  13577.                         goAwayFlag:  BOOLEAN;  {TRUE if has go-away region}
  13578.                         filler2:     BOOLEAN;  {not used}
  13579.                         refCon:      LONGINT;  {window's reference value}
  13580.                         itemsID:     INTEGER;  {resource ID of item list}
  13581.                         title:       Str255    {window's title}
  13582.                       END;
  13583.  
  13584. The filler1 and filler2 fields are there because for historical reasons the goAwayFlag
  13585. and refCon fields have to begin on a word boundary. The itemsID field contains the
  13586. resource ID of the dialog’s item list. The other fields are the same as the parameters
  13587. of the same name in the NewDialog function; they provide information about the dialog
  13588. window.
  13589.  
  13590. You access the dialog template by converting the handle returned by the Resource
  13591. Manager to a template handle:
  13592.  
  13593. TYPE  DialogTHndl  = ^DialogTPtr;
  13594.       DialogTPtr   = ^DialogTemplate;
  13595.  
  13596. æKY AlertTemplate
  13597. AlertTPtr
  13598. AlertTHndl
  13599. æFc Dialogs.h
  13600. æT struct
  13601. æD struct AlertTemplate {
  13602.     Rect boundsRect;
  13603.     short itemsID;
  13604.     StageList stages;
  13605. };
  13606.  
  13607. typedef struct AlertTemplate AlertTemplate;
  13608. typedef AlertTemplate *AlertTPtr, **AlertTHndl;
  13609.  
  13610. æC 
  13611.  »Alert Templates in Memory
  13612.  
  13613. The data structure of an alert template is as follows:
  13614.  
  13615. TYPE AlertTemplate = RECORD
  13616.                        boundsRect:  Rect;      {becomes window's portRect}
  13617.                        itemsID:     INTEGER;   {resource ID of item list}
  13618.                        stages:      StageList  {alert stage information}
  13619.                      END;
  13620.  
  13621. BoundsRect is the rectangle that becomes the portRect of the window's grafPort. The
  13622. itemsID field contains the resource ID of the item list for the alert.
  13623.  
  13624. The information in the stages field determines exactly what should happen at each
  13625. stage of the alert. It's packed into a word that has the following structure:
  13626.  
  13627. TYPE StageList = PACKED RECORD
  13628.                    boldItm4:  0..1;     {default button item number minus 1}
  13629.                    boxDrwn4:  BOOLEAN;  {TRUE if alert box to be drawn}
  13630.                    sound4:    0..3      {sound number}
  13631.                    boldItm3:  0..1; 
  13632.                    boxDrwn3:  BOOLEAN; 
  13633.                    sound3:    0..3 
  13634.                    boldItm2:  0..1; 
  13635.                    boxDrwn2:  BOOLEAN; 
  13636.                    sound2:    0..3 
  13637.                    boldItm1:  0..1; 
  13638.                    boxDrwn1:  BOOLEAN; 
  13639.                    sound1:    0..3 
  13640.                  END;
  13641.  
  13642. Notice that the information is stored in reverse order—for the fourth stage first,
  13643. and for the first stage last.
  13644.  
  13645. The boldItm field indicates which button should be the default button (and therefore
  13646. boldly outlined in the alert box). If the first two items in the alert’s item list
  13647. are the OK button and the Cancel button, respectively, 0 will refer to the OK button
  13648. and 1 to the Cancel button. The reason for this is that the value of boldItm plus 1
  13649. is interpreted as an item number, and normally items 1 and 2 are the OK and Cancel
  13650. buttons, respectively. Whatever the item having the corresponding item number happens
  13651. to be, a bold rounded-corner rectangle will be drawn outside its display rectangle.
  13652.  
  13653. Note:  When deciding where to place items in an alert box, be sure to allow
  13654.        room for any bold outlines that may be drawn.
  13655.  
  13656. The boxDrwn field is TRUE if the alert box is to be drawn.
  13657.  
  13658. The sound field specifies which sound should be emitted at this stage of the alert,
  13659. with a number from 0 to 3 that’s passed to the current sound procedure. You can call
  13660. ErrorSound to specify your own sound procedure; if you don’t, the standard sound
  13661. procedure will be used (as described earlier in the “Alerts” section).
  13662.  
  13663. You access the alert template by converting the handle returned by the Resource
  13664. Manager to a template handle:
  13665.  
  13666. TYPE  AlertTHndl = ^AlertTPtr;
  13667.       AlertTPtr  = ^AlertTemplate;
  13668.  
  13669. Assembly-language note:  Rather than offsets into the fields of the StageList
  13670.                          data structure, there are masks for accessing the
  13671.                          information stored for an alert stage in a stages
  13672.                          word; they’re listed in the summary at the end of
  13673.                          this chapter.
  13674.  
  13675. æKY InitDialogs
  13676. æFc Dialogs.h
  13677. æT Function
  13678. æTN A97B
  13679. æD pascal void InitDialogs(ResumeProcPtr resumeProc)
  13680.     = 0xA97B; 
  13681. æDT InitDialogs((ResumeProcPtr) resumeProc);
  13682. æRI I-411, P-107, 112, 174
  13683. æC  
  13684. Call InitDialogs once before all other Dialog Manager routines, to initialize the
  13685. Dialog Manager. InitDialogs does the following initialization:
  13686.  
  13687.   •  It saves the pointer passed in resumeProc, if any, for access by the
  13688.      System Error Handler in case a fatal system error occurs. ResumeProc
  13689.      can be a pointer to a resume procedure, as described in the System
  13690.      Error Handler chapter, or NIL if no such procedure is desired.
  13691.  
  13692. Assembly-language note:  InitDialogs stores the address of the resume
  13693.                          procedure in a global variable named ResumeProc.
  13694.  
  13695.   •  It installs the standard sound procedure.
  13696.   •  It passes empty strings to ParamText.
  13697.  
  13698. æKY ErrorSound
  13699. æFc Dialogs.h
  13700. æT Function
  13701. æTN A98C
  13702. æD pascal void ErrorSound(SoundProcPtr soundProc)
  13703.     = 0xA98C; 
  13704. æDT ErrorSound((SoundProcPtr) soundProc);
  13705. æRI I-411
  13706. æC  
  13707. ErrorSound sets the sound procedure for alerts to the procedure pointed to by soundProc;
  13708. if you don’t call ErrorSound, the Dialog Manager uses the standard sound procedure.
  13709. (For details, see the “Alerts” section.) If you pass NIL for soundProc, there will be
  13710. no sound (or menu bar blinking) at all.
  13711.  
  13712. Assembly-language note:  The address of the sound procedure being used is
  13713.                          stored in the global variable DABeeper.
  13714.  
  13715. æKY NewDialog
  13716. æFc Dialogs.h
  13717. æT Function
  13718. æTN A97D
  13719. æD pascal DialogPtr NewDialog(Ptr wStorage,const Rect *boundsRect,const Str255 title,
  13720.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  13721.     Handle itmLstHndl)
  13722.     = 0xA97D; 
  13723. æDT DialogPtr myVariable = NewDialog((Ptr) wStorage,(const Rect *) boundsRect,(const Str255) title,()
  13724.     Boolean visible,(short) procID,(WindowPtr) behind,(Boolean) goAwayFlag,(long) refCon,()
  13725.     Handle itmLstHndl);
  13726. æMM
  13727. æRI I-412, P-107, 177
  13728. æC 
  13729. NewDialog creates a dialog as specified by its parameters and returns a pointer to
  13730. the new dialog. The first eight parameters (dStorage through refCon) are passed to
  13731. the Window Manager function NewWindow, which creates the dialog window; the meanings
  13732. of these parameters are summarized below. The items parameter is a handle to the
  13733. dialog’s item list. You can get the items handle by calling the Resource Manager to
  13734. read the item list from the resource file into memory.
  13735.  
  13736. Note:  Advanced programmers can create their own item lists in memory rather
  13737.        than have them read from a resource file. The exact format is given
  13738.        later under “Formats of Resources for Dialogs and Alerts”.
  13739.  
  13740. DStorage is analogous to the wStorage parameter of NewWindow; it’s a pointer to the
  13741. storage to use for the dialog record. If you pass NIL for dStorage, the dialog record
  13742. will be allocated in the heap (which, in the case of modeless dialogs, may cause the
  13743. heap to become fragmented).
  13744.  
  13745. BoundsRect, a rectangle given in global coordinates, determines the dialog window’s
  13746. size and location. It becomes the portRect of the window’s grafPort. Remember that
  13747. the top coordinate of this rectangle should be at least 25 points below the top of
  13748. the screen for a modal dialog, to allow for the menu bar and the border around the
  13749. portRect, and at least 40 points below the top of the screen for a modeless dialog,
  13750. to allow for the menu bar and the window’s title bar.
  13751.  
  13752. Title is the title of a modeless dialog box; pass the empty string for modal dialogs.
  13753.  
  13754. If the visible parameter is TRUE, the dialog window is drawn on the screen. If it’s
  13755. FALSE, the window is initially invisible and may later be shown with a call to the
  13756. Window Manager procedure ShowWindow.
  13757.  
  13758. Note:  NewDialog generates an update event for the entire window contents,
  13759.        so the items aren’t drawn immediately, with the exception of controls.
  13760.        The Dialog Manager calls the Control Manager to draw controls, and the
  13761.        Control Manager draws them immediately rather than via the standard
  13762.        update mechanism. Because of this, the Dialog Manager calls the Window
  13763.        Manager procedure ValidRect for the enclosing rectangle of each control,
  13764.        so the controls won’t be drawn twice. If you find that the other items
  13765.        aren’t being drawn soon enough after the controls, try making the
  13766.        window invisible initially and then calling ShowWindow to show it.
  13767.  
  13768. ProcID is the window definition ID, which leads to the window definition function for
  13769. this type of window. The window definition IDs for the standard types of dialog
  13770. window are dBoxProc for the modal type and documentProc for the modeless type.
  13771.  
  13772. The behind parameter specifies the window behind which the dialog window is to be
  13773. placed on the desktop. Pass POINTER(–1) to bring up the dialog window in front of all
  13774. other windows.
  13775.  
  13776. GoAwayFlag applies to modeless dialog boxes; if it’s TRUE, the dialog window has a
  13777. close box in its title bar when the window is active.
  13778.  
  13779. RefCon is the dialog window’s reference value, which the application may store into
  13780. and access for any purpose.
  13781.  
  13782. NewDialog sets the font of the dialog window’s grafPort to the system font or, if you
  13783. previously called SetDAFont, to the specified font. It also sets the window class in
  13784. the window record to dialogKind.
  13785.  
  13786. æKY newdialog
  13787. æFc Dialogs.h
  13788. æT Function
  13789. æTN A97D
  13790. æD DialogPtr newdialog(Ptr wStorage,const Rect *boundsRect,char *title,Boolean visible,
  13791.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle itmLstHndl); 
  13792. æDT DialogPtr myVariable = newdialog((Ptr) wStorage,(const Rect *) boundsRect,(char *) title,(Boolean) visible,()
  13793.     short procID,(WindowPtr) behind,(Boolean) goAwayFlag,(long) refCon,(Handle) itmLstHndl);
  13794. æMM
  13795. æRI I-412, P-107, 177
  13796. æC 
  13797. NewDialog creates a dialog as specified by its parameters and returns a pointer to
  13798. the new dialog. The first eight parameters (dStorage through refCon) are passed to
  13799. the Window Manager function NewWindow, which creates the dialog window; the meanings
  13800. of these parameters are summarized below. The items parameter is a handle to the
  13801. dialog’s item list. You can get the items handle by calling the Resource Manager to
  13802. read the item list from the resource file into memory.
  13803.  
  13804. Note:  Advanced programmers can create their own item lists in memory rather
  13805.        than have them read from a resource file. The exact format is given
  13806.        later under “Formats of Resources for Dialogs and Alerts”.
  13807.  
  13808. DStorage is analogous to the wStorage parameter of NewWindow; it’s a pointer to the
  13809. storage to use for the dialog record. If you pass NIL for dStorage, the dialog record
  13810. will be allocated in the heap (which, in the case of modeless dialogs, may cause the
  13811. heap to become fragmented).
  13812.  
  13813. BoundsRect, a rectangle given in global coordinates, determines the dialog window’s
  13814. size and location. It becomes the portRect of the window’s grafPort. Remember that
  13815. the top coordinate of this rectangle should be at least 25 points below the top of
  13816. the screen for a modal dialog, to allow for the menu bar and the border around the
  13817. portRect, and at least 40 points below the top of the screen for a modeless dialog,
  13818. to allow for the menu bar and the window’s title bar.
  13819.  
  13820. Title is the title of a modeless dialog box; pass the empty string for modal dialogs.
  13821.  
  13822. If the visible parameter is TRUE, the dialog window is drawn on the screen. If it’s
  13823. FALSE, the window is initially invisible and may later be shown with a call to the
  13824. Window Manager procedure ShowWindow.
  13825.  
  13826. Note:  NewDialog generates an update event for the entire window contents,
  13827.        so the items aren’t drawn immediately, with the exception of controls.
  13828.        The Dialog Manager calls the Control Manager to draw controls, and the
  13829.        Control Manager draws them immediately rather than via the standard
  13830.        update mechanism. Because of this, the Dialog Manager calls the Window
  13831.        Manager procedure ValidRect for the enclosing rectangle of each control,
  13832.        so the controls won’t be drawn twice. If you find that the other items
  13833.        aren’t being drawn soon enough after the controls, try making the
  13834.        window invisible initially and then calling ShowWindow to show it.
  13835.  
  13836. ProcID is the window definition ID, which leads to the window definition function for
  13837. this type of window. The window definition IDs for the standard types of dialog
  13838. window are dBoxProc for the modal type and documentProc for the modeless type.
  13839.  
  13840. The behind parameter specifies the window behind which the dialog window is to be
  13841. placed on the desktop. Pass POINTER(–1) to bring up the dialog window in front of all
  13842. other windows.
  13843.  
  13844. GoAwayFlag applies to modeless dialog boxes; if it’s TRUE, the dialog window has a
  13845. close box in its title bar when the window is active.
  13846.  
  13847. RefCon is the dialog window’s reference value, which the application may store into
  13848. and access for any purpose.
  13849.  
  13850. NewDialog sets the font of the dialog window’s grafPort to the system font or, if you
  13851. previously called SetDAFont, to the specified font. It also sets the window class in
  13852. the window record to dialogKind.
  13853.  
  13854. æKY GetNewDialog
  13855. æFc Dialogs.h
  13856. æT Function
  13857. æTN A97C
  13858. æD pascal DialogPtr GetNewDialog(short dialogID,Ptr dStorage,WindowPtr behind)
  13859.     = 0xA97C; 
  13860. æDT DialogPtr myVariable = GetNewDialog((short) dialogID,(Ptr) dStorage,(WindowPtr) behind);
  13861. æMM
  13862. æRT 4,34
  13863. æRI I-413, V-284, N4-1,  P-107, 172
  13864. æC 
  13865. Like NewDialog (above), GetNewDialog creates a dialog as specified by its parameters
  13866. and returns a pointer to the new dialog. Instead of having the parameters boundsRect,
  13867. title, visible, procID, goAwayFlag, and refCon, GetNewDialog has a single dialogID
  13868. parameter, where dialogID is the resource ID of a dialog template that supplies the
  13869. same information as those parameters. The dialog template also contains the resource
  13870. ID of the dialog’s item list. After calling the Resource Manager to read the item
  13871. list into memory (if it’s not already in memory), GetNewDialog makes a copy of the
  13872. item list and uses that copy; thus you may have multiple independent dialogs whose
  13873. items have the same types, locations, and initial contents. The dStorage and behind
  13874. parameters of GetNewDialog have the same meaning as in NewDialog.
  13875.  
  13876. Warning:  If either the dialog template resource or the item list
  13877.           resource can’t be read, the function result is undefined.
  13878.  
  13879. Note:  GetNewDialog doesn’t release the memory occupied by the resources.
  13880.  
  13881. The GetNewDialog routine will attempt to load a 'dctb' resource and returns a pointer
  13882. to a color grafPort if the resource exists. If no 'dctb' resource is present, GetNewDialog
  13883. returns a pointer to an old grafPort.
  13884.  
  13885. The dialog color table is copied before it is passed to SetWinSize unless its ctSize
  13886. field is equal to –1, indicating that the default window colors are to be used instead.
  13887. The copy is made so that the color table resource can be purged without affecting the
  13888. dialog.
  13889.  
  13890. The color dialog item list resource is duplicated as well, so it can be purgeable.
  13891.  
  13892. æKY CloseDialog
  13893. æFc Dialogs.h
  13894. æT Function
  13895. æTN A982
  13896. æD pascal void CloseDialog(DialogPtr theDialog)
  13897.     = 0xA982; 
  13898. æDT CloseDialog((DialogPtr) theDialog);
  13899. æMM
  13900. æRI I-413, P-107, 167
  13901. æC 
  13902. CloseDialog removes theDialog’s window from the screen and deletes it from the window
  13903. list, just as when the Window Manager procedure CloseWindow is called. It releases
  13904. the memory occupied by the following:
  13905.  
  13906.   •  The data structures associated with the dialog window (such as the
  13907.      window’s structure, content, and update regions).
  13908.   •  All the items in the dialog (except for pictures and icons, which
  13909.      might be shared resources), and any data structures associated with
  13910.      them. For example, it would dispose of the region occupied by the
  13911.      thumb of a scroll bar, or a similar region for some other control
  13912.      in the dialog.
  13913.  
  13914. CloseDialog does not dispose of the dialog record or the item list. Figure 10 illustrates
  13915. the effect of CloseDialog (and DisposDialog, described below).
  13916.  
  13917. •••Refer to Figure 10.•••
  13918.  
  13919. Figure 10–CloseDialog and DisposDialog
  13920.  
  13921. Call CloseDialog when you’re done with a dialog if you supplied NewDialog or GetNewDialog
  13922. with a pointer to the dialog storage (in the dStorage parameter) when you created the
  13923. dialog.
  13924.  
  13925. Note:  Even if you didn’t supply a pointer to the dialog storage, you may
  13926.        want to call CloseDialog if you created the dialog with NewDialog.
  13927.        You would call CloseDialog if you wanted to keep the item list around
  13928.        (since, unlike GetNewDialog, NewDialog does not use a copy of the
  13929.        item list).
  13930.  
  13931. æKY DisposDialog
  13932. æFc Dialogs.h
  13933. æT Function
  13934. æTN A983
  13935. æD pascal void DisposDialog(DialogPtr theDialog)
  13936.     = 0xA983; 
  13937. æDT DisposDialog((DialogPtr) theDialog);
  13938. æRI I-415
  13939. æC 
  13940. DisposDialog calls CloseDialog (above) and then releases the memory occupied by the
  13941. dialog’s item list and dialog record. Call DisposDialog when you’re done with a
  13942. dialog if you let the dialog record be allocated in the heap when you created the
  13943. dialog (by passing NIL as the dStorage parameter to NewDialog or GetNewDialog).
  13944.  
  13945. æKY CouldDialog
  13946. æFc Dialogs.h
  13947. æT Function
  13948. æTN A979
  13949. æD pascal void CouldDialog(short dialogID)
  13950.     = 0xA979; 
  13951. æDT CouldDialog((short) dialogID);
  13952. æMM
  13953. æRI I-415, V-284
  13954. æC 
  13955. CouldDialog makes the dialog template having the given resource ID unpurgeable
  13956. (reading it into memory if it’s not already there). It does the same for the dialog
  13957. window’s definition function, the dialog’s item list resource, and any items defined
  13958. as resources. This is useful if the dialog box may come up when the resource file
  13959. isn’t accessible, such as during a disk copy.
  13960.  
  13961. Warning:  CouldDialog assumes your dialogs use the system font; if you’ve
  13962.           changed the font with SetDAFont, calling CouldDialog doesn’t make
  13963.           the font unpurgeable.
  13964.  
  13965. The CouldDialog procedure makes the dialog color table template unpurgeable
  13966. (reading it into memory if it isn’t already there), if it exists. It does the same
  13967. for the dialog’s color item list, if it has one.
  13968.  
  13969. Warning:  CouldDialog doesn’t load or make 'FONT' or 'FOND' resources
  13970.           indicated in the color item list unpurgeable.
  13971.  
  13972. æKY FreeDialog
  13973. æFc Dialogs.h
  13974. æT Function
  13975. æTN A97A
  13976. æD pascal void FreeDialog(short dialogID)
  13977.     = 0xA97A; 
  13978. æDT FreeDialog((short) dialogID);
  13979. æMM
  13980. æRI I-415, V-284
  13981. æC 
  13982. Given the resource ID of a dialog template previously specified in a call to CouldDialog,
  13983. FreeDialog undoes the effect of CouldDialog (by making the resources purgeable). It
  13984. should be called when there’s no longer a need to keep the resources in memory.
  13985.  
  13986. Given the resource ID of a dialog template previously specified in a call to CouldDialog,
  13987. the FreeDialog routine undoes the effect of CouldDialog, by restoring the original
  13988. purge state of the color table and color item list resources.
  13989.  
  13990. æKY ParamText
  13991. æFc Dialogs.h
  13992. æT Function
  13993. æTN A98B
  13994. æD pascal void ParamText(const Str255 param0,const Str255 param1,const Str255 param2,
  13995.     const Str255 param3)
  13996.     = 0xA98B; 
  13997. æDT ParamText((const Str255) param0,(const Str255) param1,(const Str255) param2,(
  13998.     const) Str255 param3);
  13999. æMM
  14000. æRI I-421
  14001. æC  
  14002. ParamText provides a means of substituting text in statText items:  param0 through
  14003. param3 will replace the special strings '^0' through '^3' in all statText items in
  14004. all subsequent dialog or alert boxes. Pass empty strings for parameters not used.
  14005.  
  14006. Assembly-language note:  Assembly-language programmers may pass NIL for
  14007.                          parameters not used or for strings that are not
  14008.                          to be changed.
  14009.  
  14010. For example, if the text is defined as 'Cannot open document ^0' and docName is a
  14011. string variable containing a document name that the user typed, you can call ParamText(docName,'
  14012. ',' ',' ')
  14013.  
  14014. Note:  All strings that may need to be translated to other languages should
  14015.        be stored in resource files.
  14016.  
  14017. Assembly-language note:  The Dialog Manager stores handles to the four
  14018.                          ParamText parameters in a global array named DAStrings.
  14019.  
  14020. æKY ModalDialog
  14021. æFc Dialogs.h
  14022. æT Function
  14023. æTN A991
  14024. æD pascal void ModalDialog(ModalFilterProcPtr filterProc,short *itemHit)
  14025.     = 0xA991; 
  14026. æDT ModalDialog((ModalFilterProcPtr) filterProc,(short *) itemHit);
  14027. æMM
  14028. æRT 34, 203
  14029. æRI I-415, N34-2, 3,   P-108, 176
  14030. æC  
  14031. Call ModalDialog after creating a modal dialog and bringing up its window in the
  14032. frontmost plane. ModalDialog repeatedly gets and handles events in the dialog’s
  14033. window; after handling an event involving an enabled dialog item, it returns with the
  14034. item number in itemHit. Normally you’ll then do whatever is appropriate as a response
  14035. to an event in that item.
  14036.  
  14037. ModalDialog gets each event by calling the Toolbox Event Manager function GetNextEvent.
  14038. If the event is a mouse-down event outside the content region of the dialog window,
  14039. ModalDialog emits sound number 1 (which should be a single beep) and gets the next
  14040. event; otherwise, it filters and handles the event as described below.
  14041.  
  14042. Note:  Once before getting each event, ModalDialog calls SystemTask, a
  14043.        Desk Manager procedure that must be called regularly so that desk
  14044.        accessories will work properly.
  14045.  
  14046. The filterProc parameter determines how events are filtered. If it’s NIL, the standard
  14047. filterProc function is executed; this causes ModalDialog to return 1 in itemHit if
  14048. the Return key or Enter key is pressed. If filterProc isn’t NIL, ModalDialog filters
  14049. events by executing the function it points to. Your filterProc function should have
  14050. three parameters and return a Boolean value. For example, this is how it would be
  14051. declared if it were named MyFilter:
  14052.  
  14053. FUNCTION MyFilter (theDialog:  DialogPtr; VAR theEvent:  EventRecord;
  14054.                    VAR itemHit:  INTEGER) :  BOOLEAN;
  14055.  
  14056. A function result of FALSE tells ModalDialog to go ahead and handle the event, which
  14057. either can be sent through unchanged or can be changed to simulate a different event.
  14058. A function result of TRUE tells ModalDialog to return immediately rather than handle
  14059. the event; in this case, the filterProc function sets itemHit to the item number that
  14060. ModalDialog should return.
  14061.  
  14062. Note:  If you want it to be consistent with the standard filterProc function,
  14063.        your function should at least check whether the Return key or Enter
  14064.        key was pressed and, if so, return 1 in itemHit and a function result
  14065.        of TRUE.
  14066.  
  14067. You can use the filterProc function, for example, to treat a typed character in a
  14068. special way (such as ignore it, or make it have the same effect as another character
  14069. or as clicking a button); in this case, the function would test for a key-down event
  14070. with that character. As another example, suppose the dialog box contains a userItem
  14071. whose procedure draws a clock with the current time displayed. The filterProc function
  14072. can call that procedure and return FALSE without altering the current event.
  14073.  
  14074. Note:  ModalDialog calls GetNextEvent with a mask that excludes disk-inserted
  14075.        events. To receive disk-inserted events, your filterProc function can
  14076.        call GetNextEvent (or EventAvail) with a mask that accepts only that
  14077.        type of event.
  14078.  
  14079. ModalDialog handles the events for which the filterProc function returns FALSE as
  14080. follows:
  14081.  
  14082.   •  In response to an activate or update event for the dialog window,
  14083.      ModalDialog activates or updates the window.
  14084.   •  If the mouse button is pressed in an editText item, ModalDialog
  14085.      responds to the mouse activity as appropriate (displaying an insertion
  14086.      point or selecting text). If a key-down event occurs and there’s an
  14087.      editText item, text entry and editing are handled in the standard way
  14088.      for such items (except that if the Command key is down, ModalDialog
  14089.      responds as though it’s not). In either case, ModalDialog returns if
  14090.      the editText item is enabled or does nothing if it’s disabled. If a
  14091.      key-down event occurs when there’s no editText item, ModalDialog does
  14092.      nothing.
  14093.   •  If the mouse button is pressed in a control, ModalDialog calls the
  14094.      Control Manager function TrackControl. If the mouse button is released
  14095.      inside the control and the control is enabled, ModalDialog returns;
  14096.      otherwise, it does nothing.
  14097.   •  If the mouse button is pressed in any other enabled item in the
  14098.      dialog box, ModalDialog returns. If the mouse button is pressed in
  14099.      any other disabled item or in no item, or if any other event occurs,
  14100.      ModalDialog does nothing.
  14101.  
  14102. æKY IsDialogEvent
  14103. æFc Dialogs.h
  14104. æT Function
  14105. æTN A97F
  14106. æD pascal Boolean IsDialogEvent(const EventRecord *theEvent)
  14107.     = 0xA97F; 
  14108. æDT Boolean myVariable = IsDialogEvent((const EventRecord *) theEvent);
  14109. æRI I-416, N5-1, P-108, 175
  14110. æC  
  14111. If your application includes any modeless dialogs, call IsDialogEvent after calling
  14112. the Toolbox Event Manager function GetNextEvent.
  14113.  
  14114. Warning:  If your modeless dialog contains any editText items, you must call
  14115.           IsDialogEvent (and then DialogSelect) even if GetNextEvent returns
  14116.           FALSE; otherwise your dialog won’t receive null events and the
  14117.           caret won’t blink.
  14118.  
  14119. Pass the current event in theEvent. IsDialogEvent determines whether theEvent needs
  14120. to be handled as part of a dialog. If theEvent is an activate or update event for a
  14121. dialog window, a mouse-down event in the content region of an active dialog window,
  14122. or any other type of event when a dialog window is active, IsDialogEvent returns
  14123. TRUE; otherwise, it returns FALSE.
  14124.  
  14125. When FALSE is returned, just handle the event yourself like any other event that’s
  14126. not dialog-related. When TRUE is returned, you’ll generally end up passing the event
  14127. to DialogSelect for it to handle (as described below), but first you should do some
  14128. additional checking:
  14129.  
  14130.   •  DialogSelect doesn’t handle keyboard equivalents of commands. Check
  14131.      whether the event is a key-down event with the Command key held down
  14132.      and, if so, carry out the command if it’s one that applies when a
  14133.      dialog window is active. (If the command doesn’t so apply, do nothing.)
  14134.   •  In special cases, you may want to bypass DialogSelect or do some
  14135.      preprocessing before calling it. If so, check for those events and
  14136.      respond accordingly. You would need to do this, for example, if the
  14137.      dialog is to respond to disk-inserted events.
  14138.  
  14139. For cases other than these, pass the event to DialogSelect for it to handle.
  14140.  
  14141. æKY DialogSelect
  14142. æFc Dialogs.h
  14143. æT Function
  14144. æTN A980
  14145. æD pascal Boolean DialogSelect(const EventRecord *theEvent,DialogPtr *theDialog,
  14146.     short *itemHit)
  14147.     = 0xA980; 
  14148. æDT Boolean myVariable = DialogSelect((const EventRecord *) theEvent,(DialogPtr *) theDialog,(
  14149.     short) * itemHit);
  14150. æMM
  14151. æRT 34
  14152. æRI I-417, N34-3, P-108, 168
  14153. æC 
  14154. You’ll normally call DialogSelect when IsDialogEvent returns TRUE, passing in theEvent
  14155. an event that needs to be handled as part of a modeless dialog. DialogSelect handles
  14156. the event as described below. If the event involves an enabled dialog item, DialogSelect
  14157. returns a function result of TRUE with the dialog pointer in theDialog and the item
  14158. number in itemHit; otherwise, it returns FALSE with theDialog and itemHit undefined.
  14159. Normally when DialogSelect returns TRUE, you’ll do whatever is appropriate as a
  14160. response to the event, and when it returns FALSE you’ll do nothing.
  14161.  
  14162. If the event is an activate or update event for a dialog window, DialogSelect activates
  14163. or updates the window and returns FALSE.
  14164.  
  14165. If the event is a mouse-down event in an editText item, DialogSelect responds as
  14166. appropriate (displaying a caret at the insertion point or selecting text). If it’s a
  14167. key-down or auto-key event and there’s an editText item, text entry and editing are
  14168. handled in the standard way. In either case, DialogSelect returns TRUE if the editText
  14169. item is enabled or FALSE if it’s disabled. If a key-down or auto-key event is passed
  14170. when there’s no editText item, DialogSelect returns FALSE.
  14171.  
  14172. Note:  For a keyboard event, DialogSelect doesn’t check to see whether the
  14173.        Command key is held down; to handle keyboard equivalents of commands,
  14174.        you have to check for them before calling DialogSelect. Similarly, to
  14175.        treat a typed character in a special way (such as ignore it, or make
  14176.        it have the same effect as another character or as clicking a button),
  14177.        you need to check for a key-down event with that character before
  14178.        calling DialogSelect.
  14179.  
  14180. If the event is a mouse-down event in a control, DialogSelect calls the Control
  14181. Manager function TrackControl. If the mouse button is released inside the control and
  14182. the control is enabled, DialogSelect returns TRUE; otherwise, it returns FALSE.
  14183.  
  14184. If the event is a mouse-down event in any other enabled item, DialogSelect returns
  14185. TRUE. If it’s a mouse-down event in any other disabled item or in no item, or if it’s
  14186. any other event, DialogSelect returns FALSE.
  14187.  
  14188. Note:  If the event isn’t one that DialogSelect specifically checks for (if
  14189.        it’s a null event, for example), and there’s an editText item in the
  14190.        dialog, DialogSelect calls the TextEdit procedure TEIdle to make the
  14191.        caret blink.
  14192.  
  14193. æKY DrawDialog
  14194. æFc Dialogs.h
  14195. æT Function
  14196. æTN A981
  14197. æD pascal void DrawDialog(DialogPtr theDialog)
  14198.     = 0xA981; 
  14199. æDT DrawDialog((DialogPtr) theDialog);
  14200. æMM
  14201. æRI I-418
  14202. æC 
  14203. DrawDialog draws the contents of the given dialog box. Since DialogSelect and ModalDialog
  14204. handle dialog window updating, this procedure is useful only in unusual situations.
  14205. You would call it, for example, to display a dialog box that doesn’t require any
  14206. response but merely tells the user what’s going on during a time-consuming process.
  14207.  
  14208. æKY UpdtDialog
  14209. æFc Dialogs.h
  14210. æT Function
  14211. æTN A978
  14212. æD pascal void UpdtDialog(DialogPtr theDialog,RgnHandle updateRgn)
  14213.     = 0xA978; 
  14214. æDT UpdtDialog((DialogPtr) theDialog,(RgnHandle) updateRgn);
  14215. æMM
  14216. æRI IV-60
  14217. æC  
  14218. UpdtDialog is a faster version of the DrawDialog procedure. Instead of drawing the
  14219. entire contents of the given dialog box, UpdtDialog draws only the items that are in
  14220. a specified update region. UpdtDialog is called in response to an update event, and
  14221. is usually bracketed by calls to the Window Manager procedures BeginUpdate and EndUpdate.
  14222. UpdateRgn should be set to the visRgn of theWindow’s port. (For more details, see the
  14223. BeginUpdate procedure in the Window Manager chapter.)
  14224.  
  14225. æKY Alert
  14226. æFc Dialogs.h
  14227. æT Function
  14228. æTN A985
  14229. æD pascal short Alert(short alertID,ModalFilterProcPtr filterProc)
  14230.     = 0xA985; 
  14231. æDT short myVariable = Alert((short) alertID,(ModalFilterProcPtr) filterProc);
  14232. æMM
  14233. æRI I-418, V-284
  14234. æC 
  14235. This function invokes the alert defined by the alert template that has the given
  14236. resource ID. It calls the current sound procedure, if any, passing it the sound
  14237. number specified in the alert template for this stage of the alert. If no alert box
  14238. is to be drawn at this stage, Alert returns a function result of –1; otherwise, it
  14239. creates and displays the alert window for this alert and draws the alert box.
  14240.  
  14241. Warning:  If the alert template resource can’t be read, the function result
  14242.           is undefined.
  14243.  
  14244. Note:  Alert creates the alert window by calling NewDialog, and does the
  14245.        rest of its processing by calling ModalDialog.
  14246.  
  14247. Alert repeatedly gets and handles events in the alert window until an enabled item is
  14248. clicked, at which time it returns the item number. Normally you’ll then do whatever
  14249. is appropriate in response to a click of that item.
  14250.  
  14251. Alert gets each event by calling the Toolbox Event Manager function GetNextEvent. If
  14252. the event is a mouse-down event outside the content region of the alert window, Alert
  14253. emits sound number 1 (which should be a single beep) and gets the next event; otherwise,
  14254. it filters and handles the event as described below.
  14255.  
  14256. The filterProc parameter has the same meaning as in ModalDialog (see above). If it’s
  14257. NIL, the standard filterProc function is executed, which makes the Return key or the
  14258. Enter key have the same effect as clicking the default button. If you specify your
  14259. own filterProc function and want to retain this feature, you must include it in your
  14260. function. You can find out what the current default button is by looking at the
  14261. aDefItem field of the dialog record for the alert
  14262. (via the dialog pointer passed to the function).
  14263.  
  14264. Alert handles the events for which the filterProc function returns FALSE as follows:
  14265.  
  14266.   •  If the mouse button is pressed in a control, Alert calls the Control
  14267.      Manager procedure TrackControl. If the mouse button is released inside
  14268.      the control and the control is enabled, Alert returns; otherwise, it
  14269.      does nothing.
  14270.   •  If the mouse button is pressed in any other enabled item, Alert simply
  14271.      returns. If it’s pressed in any other disabled item or in no item, or
  14272.      if any other event occurs, Alert does nothing.
  14273.  
  14274. Before returning to the application with the item number, Alert removes the alert box
  14275. from the screen. (It disposes of the alert window and its associated data structures,
  14276. the item list, and the items.)
  14277.  
  14278. Note:  When an alert is removed, if it was overlapping the default button
  14279.        of a previous alert, that button’s bold outline won’t be redrawn.
  14280.  
  14281. Note:  The Alert function’s removal of the alert box would not be the
  14282.        desired result if the user clicked a check box or radio button;
  14283.        however, normally alerts contain only static text, icons, pictures,
  14284.        and buttons that are supposed to make the alert box go away. If your
  14285.        alert contains other items besides these, consider whether it might
  14286.        be more appropriate as a dialog.
  14287.  
  14288. The Alert function looks for a resource of type 'actb' with the same ID as the alert.
  14289. The alert color table is copied before it is passed to SetWinSize unless its ctSize
  14290. field is equal to –1, indicating that the default window colors are to be used instead.
  14291. The copy is made so that the color table resource can be purged without affecting the
  14292. alert.
  14293.  
  14294. The color dialog item list resource is duplicated as well, so it can be purgeable.
  14295.  
  14296. æKY StopAlert
  14297. æFc Dialogs.h
  14298. æT Function
  14299. æTN A986
  14300. æD pascal short StopAlert(short alertID,ModalFilterProcPtr filterProc)
  14301.     = 0xA986; 
  14302. æDT short myVariable = StopAlert((short) alertID,(ModalFilterProcPtr) filterProc);
  14303. æMM
  14304. æRI I-419, V-284, P-109, 182
  14305. æC  
  14306. StopAlert is the same as the Alert function (above) except that before drawing the
  14307. items of the alert in the alert box, it draws the Stop icon in the top left corner of
  14308. the box (within the rectangle (10,20)(42,52)). The Stop icon has the following resource
  14309. ID:
  14310.  
  14311. CONST stopIcon = 0;
  14312.  
  14313. If the application’s resource file doesn’t include an icon with that ID number, the
  14314. Dialog Manager uses the standard Stop icon in the system resource file (see Figure
  14315. 11).
  14316.  
  14317. The calls CautionAlert, StopAlert, and NoteAlert look for a resource of type
  14318. 'actb' with the same ID as the alert.
  14319.  
  14320. •••Refer to Figure 11.•••
  14321.  
  14322. Figure 11–Standard Alert Icons
  14323.  
  14324. æKY NoteAlert
  14325. æFc Dialogs.h
  14326. æT Function
  14327. æTN A987
  14328. æD pascal short NoteAlert(short alertID,ModalFilterProcPtr filterProc)
  14329.     = 0xA987; 
  14330. æDT short myVariable = NoteAlert((short) alertID,(ModalFilterProcPtr) filterProc);
  14331. æMM
  14332. æRI I-420
  14333. æC  
  14334. NoteAlert is like StopAlert except that it draws the Note icon, which has the following
  14335. resource ID:
  14336.  
  14337. CONST noteIcon = 1;
  14338.  
  14339. The calls CautionAlert, StopAlert, and NoteAlert look for a resource of type
  14340. 'actb' with the same ID as the alert.
  14341.  
  14342. æKY CautionAlert
  14343. æFc Dialogs.h
  14344. æT Function
  14345. æTN A988
  14346. æD pascal short CautionAlert(short alertID,ModalFilterProcPtr filterProc)
  14347.     = 0xA988; 
  14348. æDT short myVariable = CautionAlert((short) alertID,(ModalFilterProcPtr) filterProc);
  14349. æMM
  14350. æRI I-420
  14351. æC  
  14352. CautionAlert is like StopAlert except that it draws the Caution icon, which has the
  14353. following resource ID:
  14354.  
  14355. CONST cautionIcon = 2;
  14356.  
  14357. The calls CautionAlert, StopAlert, and NoteAlert look for a resource of type
  14358. 'actb' with the same ID as the alert.
  14359.  
  14360. æKY CouldAlert
  14361. æFc Dialogs.h
  14362. æT Function
  14363. æTN A989
  14364. æD pascal void CouldAlert(short alertID)
  14365.     = 0xA989; 
  14366. æDT CouldAlert((short) alertID);
  14367. æMM
  14368. æRI I-420, V-285
  14369. æC 
  14370. CouldAlert makes the alert template having the given resource ID unpurgeable
  14371. (reading it into memory if it’s not already there). It does the same for the alert
  14372. window’s definition function, the alert’s item list resource, and any items defined
  14373. as resources. This is useful if the alert may occur when the resource file isn’t
  14374. accessible, such as during a disk copy.
  14375.  
  14376. Warning:  Like CouldDialog, CouldAlert assumes your alerts use the system
  14377.           font; if you’ve changed the font with SetDAFont, calling CouldAlert
  14378.           doesn’t make the font unpurgeable.
  14379.  
  14380. The CouldAlert routine makes the alert color table template unpurgeable
  14381. (reading it into memory if it isn’t already there), if it exists. It does the same
  14382. for the alert’s color item list, if it has one.
  14383.  
  14384. Warning:  Like CouldDialog, CouldAlert doesn’t load or make 'FONT' or
  14385.           'FOND' resources indicated in the color item list unpurgeable.
  14386.  
  14387. æKY FreeAlert
  14388. æFc Dialogs.h
  14389. æT Function
  14390. æTN A98A
  14391. æD pascal void FreeAlert(short alertID)
  14392.     = 0xA98A; 
  14393. æDT FreeAlert((short) alertID);
  14394. æMM
  14395. æRI I-420, V-285
  14396. æC 
  14397. Given the resource ID of an alert template previously specified in a call to CouldAlert,
  14398. FreeAlert undoes the effect of CouldAlert (by making the resources purgeable). It
  14399. should be called when there’s no longer a need to keep the resources in memory.
  14400.  
  14401. Given the resource ID of an alert template previously specified in a call to CouldAlert,
  14402. the FreeAlert routine undoes the effect of CouldAlert, by restoring the original
  14403. purge state of the color table and color item list resources.
  14404.  
  14405. æKY GetDItem
  14406. æFc Dialogs.h
  14407. æT Function
  14408. æTN A98D
  14409. æD pascal void GetDItem(DialogPtr theDialog,short itemNo,short *itemType,Handle *item,
  14410.     Rect *box)
  14411.     = 0xA98D; 
  14412. æDT GetDItem((DialogPtr) theDialog,(short) itemNo,(short *) itemType,(Handle *) item,(
  14413.     Rect) * box);
  14414. æMM
  14415. æRI I-421
  14416. æC  
  14417. GetDItem returns in its VAR parameters the following information about the item
  14418. numbered itemNo in the given dialog’s item list:  In the itemType parameter, the item
  14419. type; in the item parameter, a handle to the item (or, for item type userItem, the
  14420. procedure pointer); and in the box parameter, the display rectangle for the item.
  14421.  
  14422. Suppose, for example, that you want to change the title of a control in a dialog box.
  14423. You can get the item handle with GetDItem, coerce it to type ControlHandle, and call
  14424. the Control Manager procedure SetCTitle to change the title. Similarly, to move the
  14425. control or change its size, you would call MoveControl or SizeControl.
  14426.  
  14427. Note:  To access the text of a statText or editText item, you can pass the
  14428.        handle returned by GetDItem to GetIText or SetIText (see below).
  14429.  
  14430. æKY SetDItem
  14431. æFc Dialogs.h
  14432. æT Function
  14433. æTN A98E
  14434. æD pascal void SetDItem(DialogPtr theDialog,short itemNo,short itemType,Handle item,
  14435.     const Rect *box)
  14436.     = 0xA98E; 
  14437. æDT SetDItem((DialogPtr) theDialog,(short) itemNo,(short) itemType,(Handle) item,(
  14438.     const Rect) * box);
  14439. æMM
  14440. æRT 34
  14441. æRI I-421, N34-1
  14442. æC  
  14443. SetDItem sets the item numbered itemNo in the given dialog’s item list, as specified
  14444. by the parameters (without drawing the item). The itemType parameter is the item
  14445. type; the item parameter is a handle to the item (or, for item type userItem, the
  14446. procedure pointer); and the box parameter is the display rectangle for the item.
  14447.  
  14448. Consider, for example, how to install an item of type userItem in a dialog:  In the
  14449. item list in the resource file, define an item in which the type is set to userItem
  14450. and the display rectangle to (0,0)(0,0). Specify that the dialog window be invisible
  14451. (in either the dialog template or the NewDialog call). After creating the dialog,
  14452. coerce the item’s procedure pointer to type Handle; then call SetDItem, passing that
  14453. handle and the display rectangle for the item. Finally, call the Window Manager
  14454. procedure ShowWindow to display the dialog window.
  14455.  
  14456. Note:  Do not use SetDItem to change the text of a statText or editText item
  14457.        or to change or move a control. See the description of GetDItem above
  14458.        for more information.
  14459.  
  14460. æKY HideDItem
  14461. æFc Dialogs.h
  14462. æT Function
  14463. æTN A827
  14464. æD pascal void HideDItem(DialogPtr theDialog,short itemNo)
  14465.     = 0xA827; 
  14466. æDT HideDItem((DialogPtr) theDialog,(short) itemNo);
  14467. æMM
  14468. æRI IV-59
  14469. æC 
  14470. HideDItem hides the item numbered itemNo in the given dialog’s item list by giving
  14471. the item a display rectangle that’s off the screen. (Specifically, if the left coordinate
  14472. of the item’s display rectangle is less than 8192, ShowDItem adds 16384 to both the
  14473. left and right coordinates the rectangle.) If the item is already hidden (that is, if
  14474. the left coordinate is greater than 8192), HideDItem does nothing.
  14475.  
  14476. HideDItem calls the EraseRect procedure on the item’s enclosing rectangle and adds
  14477. the rectangle that contained the item (not necessarily the item’s display rectangle)
  14478. to the update region. If the specified item is an active editText item, the item is
  14479. first deactivated (by calling TEDeactivate).
  14480.  
  14481. Note:  If you have items that are close to each other, be aware that the
  14482.        Dialog Manager draws outside of the enclosing rectangle by 3 pixels
  14483.        for editText items and by 4 pixels for a default button.
  14484.  
  14485. An item that’s been hidden by HideDItem can be redisplayed by the ShowDItem procedure.
  14486.  
  14487. Note:  To create a hidden item in a dialog item list, simply add 16384 to
  14488.        the left and right coordinates of the display rectangle.
  14489.  
  14490. æKY ShowDItem
  14491. æFc Dialogs.h
  14492. æT Function
  14493. æTN A828
  14494. æD pascal void ShowDItem(DialogPtr theDialog,short itemNo)
  14495.     = 0xA828; 
  14496. æDT ShowDItem((DialogPtr) theDialog,(short) itemNo);
  14497. æMM
  14498. æRI IV-59
  14499. æC 
  14500. ShowDItem redisplays the item numbered itemNo, previously hidden by HideDItem, by
  14501. giving the item the display rectangle it had prior to the HideDItem call.
  14502. (Specifically, if the left coordinate of the item’s display rectangle is greater than
  14503. 8192, ShowDItem subtracts 16384 from both the left and right coordinates of the rectangle.)
  14504. If the item is already visible (that is, if the left coordinate is less than 8192),
  14505. ShowDItem does nothing.
  14506.  
  14507. ShowDItem adds the rectangle that contained the item (not necessarily the
  14508. item’s display rectangle) to the update region so that it will be drawn. If the item
  14509. becomes the only editText item, ShowDItem activates it (by calling TEActivate).
  14510.  
  14511. æKY SelIText
  14512. æFc Dialogs.h
  14513. æT Function
  14514. æTN A97E
  14515. æD pascal void SelIText(DialogPtr theDialog,short itemNo,short strtSel,short endSel)
  14516.     = 0xA97E; 
  14517. æDT SelIText((DialogPtr) theDialog,(short) itemNo,(short) strtSel,(short) endSel);
  14518. æMM
  14519. æRI I-422, P-110
  14520. æC 
  14521. Given a pointer to a dialog and the item number of an editText item in the dialog
  14522. box, SelIText does the following:
  14523.  
  14524.   •  If the item contains text, SelIText sets the selection range to extend
  14525.      from character position strtSel up to but not including character
  14526.      position endSel. The selection range is inverted unless strtSel equals
  14527.      endSel, in which case a blinking vertical bar is displayed to indicate
  14528.      an insertion point at that position.
  14529.   •  If the item doesn’t contain text, SelIText simply displays the insertion
  14530.      point.
  14531.  
  14532. For example, if the user makes an unacceptable entry in the editText item, the application
  14533. can put up an alert box reporting the problem and then select the entire text of the
  14534. item so it can be replaced by a new entry. (Without this procedure, the user would
  14535. have to select the item before making the new entry.)
  14536.  
  14537. Note:  You can select the entire texxt by specifying 0 for strtSel and 32767
  14538.        for endSel. For details about selection range and character position,
  14539.        see the TextEdit chapter.
  14540.  
  14541. æKY GetIText
  14542. æFc Dialogs.h
  14543. æT Function
  14544. æTN A990
  14545. æD pascal void GetIText(Handle item,Str255 text)
  14546.     = 0xA990; 
  14547. æDT GetIText((Handle) item,(Str255) text);
  14548. æRT 18
  14549. æRI I-422, N18-2
  14550. æC  
  14551. Given a handle to a statText or editText item in a dialog box, as returned by GetDItem,
  14552. GetIText returns the text of the item in the text parameter. (If the user typed more
  14553. than 255 characters in an editText item, GetIText returns only the first 255.)
  14554.  
  14555. æKY SetIText
  14556. æFc Dialogs.h
  14557. æT Function
  14558. æTN A98F
  14559. æD pascal void SetIText(Handle item,const Str255 text)
  14560.     = 0xA98F; 
  14561. æDT SetIText((Handle) item,(const Str255) text);
  14562. æMM
  14563. æRI I-422
  14564. æC 
  14565. Given a handle to a statText or editText item in a dialog box, as returned by GetDItem,
  14566. SetIText sets the text of the item to the specified text and draws the item. For
  14567. example, suppose the exact content of a dialog’s text item cannot be determined until
  14568. the application is running, but the display rectangle is defined in the resource
  14569. file:  Call GetDItem to get a handle to the item, and call SetIText with the desired
  14570. text.
  14571.  
  14572. æKY FindDItem
  14573. æFc Dialogs.h
  14574. æT Function
  14575. æTN A984
  14576. æD pascal short FindDItem(DialogPtr theDialog,Point thePt)
  14577.     = 0xA984; 
  14578. æDT short myVariable = FindDItem((DialogPtr) theDialog,(Point) thePt);
  14579. æMM
  14580. æRT 112
  14581. æRI IV-60, N112
  14582. æC 
  14583. FindDItem returns the item number of the item containing the point specified, in
  14584. local coordinates, by thePt. If the point doesn’t lie within the item’s rectangle,
  14585. FindDItem returns –1. If there are overlapping items, it returns the item number of
  14586. the first item in the list containing the point. FindDItem is useful for changing the
  14587. cursor when it’s over a particular item.
  14588.  
  14589. Note:  FindDItem will return the item number of disabled items as well.
  14590.  
  14591. æKY NewCDialog
  14592. æFc Dialogs.h
  14593. æT Function
  14594. æTN AA4B
  14595. æD pascal DialogPtr NewCDialog(Ptr dStorage,const Rect *boundsRect,const Str255 title,
  14596.     Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,
  14597.     Handle items)
  14598.     = 0xAA4B; 
  14599. æDT DialogPtr myVariable = NewCDialog((Ptr) dStorage,(const Rect *) boundsRect,(const Str255) title,()
  14600.     Boolean visible,(short) procID,(WindowPtr) behind,(Boolean) goAwayFlag,(long) refCon,()
  14601.     Handle items);
  14602. æMM
  14603. æRI V-283
  14604. æC 
  14605. A new Dialog Manager routine has been added to support color dialogs: NewCDialog. 
  14606. Its parameters are identical to NewDialog, except that a cGrafPort is allocated
  14607. through a NewCWindow call instead of a call to NewWindow.
  14608.  
  14609. NewCDialog creates a dialog box as specified by its parameters and returns a cDialogPtr
  14610. to the new dialog. The first eight parameters (dStorage through refCon) are passed to
  14611. the Window Manager function NewCWindow, which creates the dialog window. The items
  14612. parameter is a handle to the dialog’s item list. You can get the items handle by
  14613. calling the Resource Manager to read the item list from the resource file into memory.
  14614.  
  14615. After calling NewCDialog, you can use SetWinColor to add a color table to the dialog.
  14616. This creates an auxiliary window record (auxWinRec) for the dialog window. You can
  14617. access this record with the GetAuxWin routine. The dialogCItem handle within the
  14618. auxWinRec points to the dialog item color table.
  14619.  
  14620. If the dialog’s content color isn’t white, it’s a good idea to call NewCDialog with
  14621. the visible flag set to FALSE. After the color table and color item list are installed,
  14622. use ShowWindow to display the dialog if the dialog is the frontmost window. If the
  14623. dialog is not in front, use ShowHide to display the dialog.
  14624.  
  14625. æKY newcdialog
  14626. æFc Dialogs.h
  14627. æT Function
  14628. æD DialogPtr newcdialog(Ptr dStorage,const Rect *boundsRect,char *title,Boolean visible,
  14629.     short procID,WindowPtr behind,Boolean goAwayFlag,long refCon,Handle items); 
  14630. æDT DialogPtr myVariable = newcdialog((Ptr) dStorage,(const Rect *) boundsRect,(char *) title,(Boolean) visible,()
  14631.     short procID,(WindowPtr) behind,(Boolean) goAwayFlag,(long) refCon,(Handle) items);
  14632. æRI V-283
  14633. æC 
  14634. A new Dialog Manager routine has been added to support color dialogs: NewCDialog. 
  14635. Its parameters are identical to NewDialog, except that a cGrafPort is allocated
  14636. through a NewCWindow call instead of a call to NewWindow.
  14637.  
  14638. NewCDialog creates a dialog box as specified by its parameters and returns a cDialogPtr
  14639. to the new dialog. The first eight parameters (dStorage through refCon) are passed to
  14640. the Window Manager function NewCWindow, which creates the dialog window. The items
  14641. parameter is a handle to the dialog’s item list. You can get the items handle by
  14642. calling the Resource Manager to read the item list from the resource file into memory.
  14643.  
  14644. After calling NewCDialog, you can use SetWinColor to add a color table to the dialog.
  14645. This creates an auxiliary window record (auxWinRec) for the dialog window. You can
  14646. access this record with the GetAuxWin routine. The dialogCItem handle within the
  14647. auxWinRec points to the dialog item color table.
  14648.  
  14649. If the dialog’s content color isn’t white, it’s a good idea to call NewCDialog with
  14650. the visible flag set to FALSE. After the color table and color item list are installed,
  14651. use ShowWindow to display the dialog if the dialog is the frontmost window. If the
  14652. dialog is not in front, use ShowHide to display the dialog.
  14653.  
  14654. æKY GetAlrtStage
  14655. æFc Dialogs.h
  14656. æT Function
  14657. æD pascal short GetAlrtStage(void)
  14658.     = {0x3EB8,0x0A9A}; 
  14659. æDT short myVariable = GetAlrtStage()(void);
  14660. æRI I-422
  14661. æC  
  14662. GetAlrtStage returns the stage of the last occurrence of an alert, as a number from 0
  14663. to 3.
  14664.  
  14665. Assembly-language note:  Assembly-language programmers can get this number
  14666.                          by accessing the global variable ACount. In addition,
  14667.                          the global variable ANumber contains the resource ID
  14668.                          of the alert template of the last alert that occurred.
  14669.  
  14670. æKY ResetAlrtStage
  14671. æFc Dialogs.h
  14672. æT Function
  14673. æD pascal void ResetAlrtStage(void)
  14674.     = {0x4278,0x0A9A}; 
  14675. æDT ResetAlrtStage()(void);
  14676. æRI I-423
  14677. æC 
  14678. ResetAlrtStage resets the stage of the last occurrence of an alert so that the next
  14679. occurrence of that same alert will be treated as its first stage. This is useful, for
  14680. example, when you’ve used ParamText to change the text of an alert such that from the
  14681. user’s point of view it’s a different alert.
  14682.  
  14683. Assembly-language note:  Assembly-language programmers can set the global
  14684.                          variable ACount to –1 for the same effect.
  14685.  
  14686. æKY DlgCut
  14687. æFc Dialogs.h
  14688. æT Function
  14689. æD pascal void DlgCut(DialogPtr theDialog); 
  14690. æDT DlgCut((DialogPtr) theDialog);
  14691. æRT 215
  14692. æRI I-418, P-110
  14693. æC 
  14694. [Not in ROM]
  14695. DlgCut checks whether theDialog has any editText items and, if so, applies the TextEdit
  14696. procedure TECut to the currently selected editText item. (If the dialog record’s
  14697. editField is 0 or greater, DlgCut passes the contents of the textH field to TECut.)
  14698. You can call DlgCut to handle the editing command Cut when a modeless dialog window
  14699. is active.
  14700.  
  14701. Assembly-language note:  Assembly-language programmers can just read the
  14702.                          dialog record’s fields and call TextEdit directly.
  14703.  
  14704. æKY DlgPaste
  14705. æFc Dialogs.h
  14706. æT Function
  14707. æD pascal void DlgPaste(DialogPtr theDialog); 
  14708. æDT DlgPaste((DialogPtr) theDialog);
  14709. æMM
  14710. æRT 215
  14711. æRI I-418, P-110
  14712. æC  
  14713. [Not in ROM]
  14714.  
  14715. DlgPaste is the same as DlgCut (above) except that it calls TEPaste, for handling the
  14716. Paste command.
  14717.  
  14718. æKY DlgCopy
  14719. æFc Dialogs.h
  14720. æT Function
  14721. æD pascal void DlgCopy(DialogPtr theDialog); 
  14722. æDT DlgCopy((DialogPtr) theDialog);
  14723. æMM
  14724. æRT 215
  14725. æRI I-418, P-110
  14726. æC 
  14727. [Not in ROM]
  14728. DlgCopy is the same as DlgCut (above) except that it calls TECopy, for handling the
  14729. Copy command.
  14730.  
  14731. æKY DlgDelete
  14732. æFc Dialogs.h
  14733. æT Function
  14734. æD pascal void DlgDelete(DialogPtr theDialog); 
  14735. æDT DlgDelete((DialogPtr) theDialog);
  14736. æMM
  14737. æRT 215
  14738. æRI I-418, P-110
  14739. æC  
  14740. [Not in ROM]
  14741.  
  14742. DlgDelete is the same as DlgCut (above) except that it calls TEDelete, for handling
  14743. the Clear command.
  14744.  
  14745. æKY SetDAFont
  14746. æFc Dialogs.h
  14747. æT Function
  14748. æD pascal void SetDAFont(short fontNum); 
  14749. æDT SetDAFont((short) fontNum);
  14750. æRI I-412
  14751. æC 
  14752. For subsequently created dialogs and alerts, SetDAFont causes the font of the dialog
  14753. or alert window’s grafPort to be set to the font having the specified font number. If
  14754. you don’t call this procedure, the system font is used. SetDAFont affects statText
  14755. and editText items but not titles of controls, which are always in the system font.
  14756.  
  14757. Assembly-language note:  Assembly-language programmers can simply set
  14758.                          the global variable DlgFont to the desired font number.
  14759.  
  14760. æKY paramtext
  14761. æFc Dialogs.h
  14762. æT Function
  14763. æD void paramtext(char *param0,char *param1,char *param2,char *param3); 
  14764. æDT paramtext((char *) param0,(char *) param1,(char *) param2,(char *) param3);
  14765. æMM
  14766. æRI I-421
  14767. æC  
  14768. ParamText provides a means of substituting text in statText items:  param0 through
  14769. param3 will replace the special strings '^0' through '^3' in all statText items in
  14770. all subsequent dialog or alert boxes. Pass empty strings for parameters not used.
  14771.  
  14772. Assembly-language note:  Assembly-language programmers may pass NIL for
  14773.                          parameters not used or for strings that are not
  14774.                          to be changed.
  14775.  
  14776. For example, if the text is defined as 'Cannot open document ^0' and docName is a
  14777. string variable containing a document name that the user typed, you can call ParamText(docName,'
  14778. ',' ',' ')
  14779.  
  14780. Note:  All strings that may need to be translated to other languages should
  14781.        be stored in resource files.
  14782.  
  14783. Assembly-language note:  The Dialog Manager stores handles to the four
  14784.                          ParamText parameters in a global array named DAStrings.
  14785.  
  14786. æKY getitext
  14787. æFc Dialogs.h
  14788. æT Function
  14789. æD void getitext(Handle item,char *text); 
  14790. æDT getitext((Handle) item,(char *) text);
  14791. æRT 18
  14792. æRI I-422, N18-2
  14793. æC  
  14794. Given a handle to a statText or editText item in a dialog box, as returned by GetDItem,
  14795. GetIText returns the text of the item in the text parameter. (If the user typed more
  14796. than 255 characters in an editText item, GetIText returns only the first 255.)
  14797.  
  14798. æKY setitext
  14799. æFc Dialogs.h
  14800. æT Function
  14801. æD void setitext(Handle item,char *text); 
  14802. æDT setitext((Handle) item,(char *) text);
  14803. æMM
  14804. æRI I-422
  14805. æC 
  14806. Given a handle to a statText or editText item in a dialog box, as returned by GetDItem,
  14807. SetIText sets the text of the item to the specified text and draws the item. For
  14808. example, suppose the exact content of a dialog’s text item cannot be determined until
  14809. the application is running, but the display rectangle is defined in the resource
  14810. file:  Call GetDItem to get a handle to the item, and call SetIText with the desired
  14811. text.
  14812.  
  14813. æKY findditem
  14814. æFc Dialogs.h
  14815. æT Function
  14816. æD short findditem(DialogPtr theDialog,Point *thePt); 
  14817. æDT short myVariable = findditem((DialogPtr) theDialog,(Point *) thePt);
  14818. æRI IV-60, N112
  14819. æC 
  14820. FindDItem returns the item number of the item containing the point specified, in
  14821. local coordinates, by thePt. If the point doesn’t lie within the item’s rectangle,
  14822. FindDItem returns –1. If there are overlapping items, it returns the item number of
  14823. the first item in the list containing the point. FindDItem is useful for changing the
  14824. cursor when it’s over a particular item.
  14825.  
  14826. Note:  FindDItem will return the item number of disabled items as well.
  14827.  
  14828.  
  14829. æKY DisAsmLookup.h
  14830. æKL Disassembler
  14831. endOfModule
  14832. InitLookup
  14833. Lookup
  14834. LookupTrapName
  14835. ModifyOperand
  14836. showMacsBugSymbol
  14837. validMacsBugSymbol
  14838.  
  14839. _A0_
  14840. _A1_
  14841. _A2_
  14842. _A3_
  14843. _A4_
  14844. _A5_
  14845. _A6_
  14846. _A7_
  14847. _ABS_
  14848. _PC_
  14849. _TRAP_
  14850. LookupRegs
  14851.  
  14852. æKY Disassembler
  14853. æFc DisAsmLookup.h
  14854. æT Function
  14855. æD pascal void Disassembler(long DstAdjust,short *BytesUsed,Ptr FirstByte,
  14856.     char *Opcode,char *Operand,char *Comment,Ptr LookUpProc);
  14857. æDT Disassembler((long)DstAdjust,(short *)BytesUsed,(Ptr)FirstByte,
  14858.     (char *)Opcode,(char *)Operand,(char *)Comment,(Ptr)LookUpProc);
  14859. æC 
  14860. /* 
  14861.     Disassembler is a Pascal routine to be called to disassemble a sequence of
  14862.     bytes.  All MC68xxx, MC68881, and MC68851 instructions are supported.  The
  14863.     sequence of bytes to be disassembled are pointed to by FirstByte.  BytesUsed
  14864.     bytes starting at FirstByte are consumed by the disassembly, and the Opcode,
  14865.     Operand, and Comment strings returned as NULL TERMINATED Pascal strings (for
  14866.     easier manipulation with C).  The caller is then free to format or use the
  14867.     output strings any way appropriate to the application.
  14868.     
  14869.     Depending on the opcode and effective address(s) (EA's) to be disassembled,
  14870.     the Opcode, Operand, and Comment strings contain the following information:
  14871.     
  14872.     Case                     Opcode    Operand    Comment
  14873.     =======================================================================
  14874.     Non PC-relative EA's     op.sz     EA's
  14875.     PC-relative EA's         op.sz     EA's       ; address
  14876.     Toolbox traps            DC.W      $AXXX      ; TB XXXX
  14877.     OS traps                 DC.W      $AXXX      ; OS XXXX
  14878.     Invalid bytes            DC.W      $XXXX      ; ????
  14879.     Invalid byte #immediate  DC.W      $XXXX,...  ; op.sz #$??XX,EA
  14880.     =======================================================================
  14881.     
  14882.     For valid disassembly of processor instructions the appropriate MC68XXX
  14883.     opcode mnemonic is generated for the Opcode string along with a size
  14884.     attribute when required. The source and destination EA's are generated as the
  14885.     Operand along with a possible comment.  Comments start with a ';'.  Traps use
  14886.     a DC.W assembler directive as the Opcode with the trap word as the Operand
  14887.     and a comment indicating whether the trap is a toolbox or OS trap and what
  14888.     the trap number is.  As described later the caller can generate symbolic
  14889.     substitutions into EA's and provide names for traps.
  14890.     
  14891.     Invalid instructions cause the string 'DC.W' to be returned in the Opcode
  14892.     string. Operand is '$XXXX' (the invalid word) with a comment of '; ????'.
  14893.     BytesUsed is 2. This is similar to the trap call case except for the comment.
  14894.     
  14895.     A special case is made for immediate byte operands with a nonzero high order
  14896.     byte.  For example, the bytes $020011FF, when actually executed, would be
  14897.     interpreted as ANDI.B $FF,D0. The processor will IGNORE the high order byte
  14898.     of the immediate data! Thus, the bytes may be considered as valid.  Since the
  14899.     Disassembler has no way of knowing the context in which it is disassembling,
  14900.     it returns the Opcode as 'DC.W' as in the normal invalid case.  However, the
  14901.     Operand string shows ALL the words disassembled separated with commas and
  14902.     places the possibly valid disassembly in the Operand's comment indicating the
  14903.     nonzero bytes. Thus for the example $020011FF bytes, the Opcode will be
  14904.     'DC.W', the Operand will be '$0200,$11FF', and the Comment 
  14905.     '; ANDI.B #$??FF,D0'.  BytesUsed in this case would be 4.
  14906.     
  14907.     Note, the Operand EA's is syntatically similar to but NOT COMPATIBLE with the
  14908.     MPW assembler!  This is because the Disassembler generates byte hex constants
  14909.     as "$XX" and word hex constants as "$XXXX".  Negative values (e.g., $FF or
  14910.     $FFFF) produced by the Disassembler are treated as long word values by the MPW
  14911.     assembler.  Thus it is assumed that Disassembler output will NOT be used as
  14912.     MPW assembler input. If that is the goal, then the caller must convert strings
  14913.     of the form $XX or $XXXX in the Operand string to their decimal equivalent.
  14914.     The routine ModifyOperand is provided in this unit to aid with the conversion
  14915.     process.
  14916.     
  14917.     Since a PC-relative comment is an address, the only address that the
  14918.     Disassembler knows about is the address of the code pointed to by FirstByte.
  14919.     Generally, that may be a buffer that has no relation to "reality", i.e., the
  14920.     actual code loaded into the buffer.  Therefore, to allow the address comment
  14921.     to be mapped back to some actual address the caller may specify an adjustment
  14922.     factor, specified by DstAdjust that is ADDED to the value that normally would
  14923.     be placed in the comment.
  14924.     
  14925.     Operand effective address strings are generated as a function of the 
  14926.     effective address mode and a special case is made for A-trap opcode strings.
  14927.     In places where a possible symbolic reference could be substituted for an
  14928.     address (or a portion of an address), the Disassembler can call a user
  14929.     specified routine to do the substitution (using th LookupProc parameter
  14930.     described later).  The following table summarizes the generated effective
  14931.     addresses and where symbolic substitutions (S) can be made:
  14932.          
  14933.     Mode    Generated Effective Address  Effective Address with Substitution
  14934.     ========================================================================
  14935.       0     Dn                           Dn
  14936.       1     An                           An
  14937.       2     (An)                         (An)
  14938.       3     (An)+                        (An)+
  14939.       4     -(An)                        -(An)
  14940.       5     ∂(An)                        S(An) or just S (if An=A5, ∂≥0)
  14941.      6n     ∂(An,Xn.Size*Scale)          S(An,Xn.Size*Scale)
  14942.      6n     (BD,An,Xn.Size*Scale)        (S,An,Xn.Size*Scale)
  14943.      6n     ([BD,An],Xm.Size*Scale,OD)   ([S,An],Xm.Size*Scale,OD)
  14944.      6n     ([BD,An,Xn.Size*Scale],OD)   ([S,An,Xn.Size*Scale],OD)
  14945.      70     ∂                            S
  14946.      71     ∂                            S
  14947.      72     *±∂                          S
  14948.      73     *±∂(Xn.Size*Scale)           S(Xn.Size*Scale)
  14949.      73     (*±∂,Xn.Size*Scale)          (S,Xn.Size*Scale)
  14950.      73     ([*±∂],Xm.Size*Scale,OD)     ([S],Xm.Size*Scale,OD)
  14951.      73     ([*±∂,Xn.Size*Scale],OD)     ([S,Xn.Size*Scale],OD)
  14952.      74     #data                        #data
  14953.     ========================================================================
  14954.     
  14955.     For A-traps, the substitution can be performed to substitute for the DC.W
  14956.     opcode string.  If the substitution is made then the Disassembler will
  14957.     generate ,Sys and/or ,Immed flags as operands for Toolbox traps and
  14958.     ,AutoPop for OS traps when the bits in the trap word indicates these
  14959.     settings.
  14960.     
  14961.             |         Generated          |            Substituted
  14962.             | Opcode  Operand  Comment   | Opcode  Operand        Comment
  14963.     ========================================================================
  14964.     Toolbox | DC.W    $AXXX    ; TB XXXX | S       [,Sys][,Immed] ; AXXX
  14965.     OS      | DC.W    $AXXX    ; OS XXXX | S       [,AutoPop]     ; AXXX
  14966.     ========================================================================
  14967.     
  14968.     All displacements (∂, BD, OD) are hexadecimal values shown as a byte ($XX),
  14969.     word ($XXXX), or long ($XXXXXXXX) as appropriate. The *Scale is suppressed if
  14970.     1. The Size is W or L.  Note that effective address substitutions can only be
  14971.     made for "∂(An)", "BD,An", and "*±∂" cases.
  14972.         
  14973.     For all the effective address modes 5, 6n, 7n, and for A-traps, a coroutine (a
  14974.     procedure) whose address is specified by the LookupProc parameter is called by
  14975.     the Disassembler (if LookupProc is not NIL) to do the substitution (or A-trap
  14976.     comment) with a string returned by the proc.  It is assumed that the proc
  14977.     pointed to by LookupProc is a level 1 Pascal proc declared as follows:
  14978.     
  14979.     PROCEDURE Lookup(     PC:      UNIV Ptr;     {Addr of extension/trap word}
  14980.                          BaseReg: LookupRegs;   {Base register/lookup mode  }
  14981.                          Opnd:    UNIV LongInt; {Trap word, PC addr, disp.  }
  14982.                      VAR S:       DisAsmStr80); {Returned substitution      }
  14983.     
  14984.     where TYPE DisAsmStr80 = String[80];
  14985.       
  14986.     or in C,
  14987.     
  14988.     pascal void LookUp(Ptr         PC, 
  14989.                        LookupRegs  BaseReg, 
  14990.                        long        Opnd, 
  14991.                        char        *S); 
  14992.     
  14993.     PC      = Pointer to instruction extension word or A-trap word in the
  14994.               buffer pointed to by the Disassembler's FirstByte parameter.
  14995.               
  14996.     BaseReg = This determines the meaning of the Opnd value and supplies
  14997.               the base register for the "∂(An)", "BD,An", and "*±∂" cases.
  14998.               BaseReg may contain any one of the following values:
  14999.              
  15000.               _A0_   =  0 ==> A0
  15001.               _A1_   =  1 ==> A1
  15002.               _A2_   =  2 ==> A2
  15003.               _A3_   =  3 ==> A3
  15004.               _A4_   =  4 ==> A4
  15005.               _A5_   =  5 ==> A5
  15006.               _A6_   =  6 ==> A6
  15007.               _A7_   =  7 ==> A7
  15008.               _PC_   =  8 ==> PC-relative (special case)
  15009.               _ABS_  =  9 ==> Abs addr    (special case)
  15010.               _TRAP_ = 10 ==> Trap word   (special case)
  15011.               
  15012.               For absolute addressing (modes 70 and 71),  BaseReg contains _ABS_.
  15013.               For A-traps, BaseReg would contain _TRAP_.
  15014.     
  15015.     Opnd    = The contents of this LongInt is determined by the BaseReg parameter
  15016.               just described.
  15017.            
  15018.               For BaseReg = _TRAP_ (A-traps):
  15019.                   Opnd is the entire trap word. The high order 16 bits of Opnd are
  15020.                   zero.
  15021.     
  15022.               For BaseReg = _ABS_  (absolute effective address):
  15023.                   Opnd contains the (extended) 32-bit address specifed by the
  15024.                   instruction's effective address.  Such addresses would generally
  15025.                   be used to reference low memory globals on a Macintosh.
  15026.     
  15027.               For BaseReg = _PC_  (PC-relative effective address):
  15028.                   Opnd contains the 32-bit address represented by "*±∂" adjusted
  15029.                   by the Disassembler's DstAdjust parameter.
  15030.                   
  15031.               For BaseReg = _An_  (effective address with a base register):
  15032.                   Opnd contains the (sign-extended) 32-bit (base) displacement
  15033.                   from the instruction's effective address.
  15034.                   
  15035.                   In the Macintosh environment, a BaseReg specifying A5 implies
  15036.                   either global data references or Jump Table references. Positive
  15037.                   Opnd values with an A5 BaseReg thus mean Jump Table references,
  15038.                   while a negative offset would mean a global data reference.
  15039.                   Base registers of A6 or A7 would usually mean local data.
  15040.     
  15041.     S       = Pascal string returned from Lookup containing the effective address
  15042.               substitution string or a trap name for A-traps.  S is set to null
  15043.               PRIOR to calling Lookup.  If it is still null on return, the string
  15044.               is not used.  If not null, then for A-traps, the returned string is
  15045.               used as a opcode string. In all other cases the string is
  15046.               substituted as shown in the above table.
  15047.                
  15048.     Depending on the application, the caller has three choices on how to use the
  15049.     Disassembler and an associated Lookup proc:
  15050.     
  15051.     (1). The caller can call just the Disassembler and provide his own Lookup
  15052.          proc. In that case the calling conventions discussed above must be
  15053.          followed.
  15054.     
  15055.     (2). The caller can provide NIL for the LookupProc parameter, in which case,
  15056.          NO Lookup proc will be called.
  15057.          
  15058.     (3). The caller can call first InitLookup (described below, a proc provided
  15059.          with this unit) and pass the address of this unit's standard Lookup proc
  15060.          when Disassembler is called.  In this case all the control logic to
  15061.          determine the kind of substitution to be done is provided for the caller
  15062.          and all that need to be provided by the user are routines to look up any
  15063.          or all of the following:
  15064.          
  15065.          • PC-relative references
  15066.          • Jump Table references
  15067.          • Absolute address references
  15068.          • Trap names
  15069.          • References with offsets from base registers 
  15070. */
  15071.  
  15072. æKY endOfModule
  15073. æFc DisAsmLookup.h
  15074. æT Function
  15075. æD char *endOfModule(void *address,void *limit,char *symbol,void **nextModule);
  15076. æDT char myVariable = endOfModule((void *)address,(void *)limit,(char *)symbol,
  15077.     (void *)*nextModule);
  15078. æC 
  15079. /* 
  15080.     Check to see if the specified memory address, contains a RTS, JMP (A0) or
  15081.     RTD #n instruction immediately followed by a valid MacsBug symbol.  These
  15082.     sequences are the only ones which can determine an end of module when MacsBug
  15083.     symbols are present.  During the check, the instruction and its following
  15084.     MacsBug symbol must be fully contained in the bytes starting at the specified
  15085.     address parameter, up to, but not including, the byte pointed to by the limit
  15086.     parameter.
  15087.     
  15088.     If the end of module is NOT found, then NULL is returned as the function's
  15089.     result.  However, if a end of module is found, the MacsBug symbol is returned
  15090.     in symbol (if it is not NULL) as a null terminated Pascal string (with trailing
  15091.     blanks removed), and the functions returns the pointer to the start of the
  15092.     MacsBug symbol (i.e., address+2 for RTS or JMP (A0) and address+4 for RTD #n).
  15093.     This address may then be used as in input parameter to showMacsBugSymbol to
  15094.     convert the MacsBug symbol to a Disassembler operand string.
  15095.     
  15096.     Also returned in nextModule is where we think the FOLLOWING module begins. In
  15097.     the "old style" cases (see validMacsBugSymbol) this will always be 8 or 16
  15098.     bytes after the input address.  For new style the Apple Pascal and C cases this
  15099.     will depend on the symbol length, existence of a pad byte, and size of the
  15100.     constant (literal) area.  See validMacsBugSymbol for a description of valid
  15101.     MacsBug symbol formats. 
  15102. */
  15103.  
  15104. æKY InitLookup
  15105. æFc DisAsmLookup.h
  15106. æT Function
  15107. æD pascal void InitLookup(Ptr PCRelProc,Ptr JTOffProc,Ptr TrapProc,Ptr AbsAddrProc,
  15108.     Ptr IdProc);
  15109. æDT InitLookup((Ptr)PCRelProc,(Ptr)JTOffProc,(Ptr)TrapProc,
  15110.     (Ptr)AbsAddrProc,(Ptr)IdProc);
  15111. æC 
  15112. /* 
  15113.     Prepare for use of this unit's Lookup proc.  When Disassembler is called
  15114.     and the address of this unit's Lookup proc is specified, then for PC-relative,
  15115.     Jump Table references, A-traps, absolute addresses, and offsets from a base
  15116.     register, the associated level 1 Pascal proc specified here is called (if not
  15117.     NULL -- all five addresses are preset to NULL). The calls assume the following
  15118.     declarations for these procs (see Lookup, below for further details):
  15119.                                  
  15120.     PROCEDURE PCRelProc(Address: UNIV LongInt; 
  15121.                         VAR S:   UNIV DisAsmStr80);
  15122.     
  15123.     PROCEDURE JTOffProc(A5JTOffset: UNIV Integer;
  15124.                         VAR S:      UNIV DisAsmStr80);
  15125.     
  15126.     PROCEDURE TrapNameProc(TrapWord: UNIV Integer;
  15127.                            VAR S:     UNIV DisAsmStr80);
  15128.                             
  15129.     PROCEDURE AbsAddrProc(AbsAddr: UNIV LongInt;
  15130.                           VAR S:   UNIV DisAsmStr80);
  15131.     
  15132.     PROCEDURE IdProc(BaseReg: LookupRegs;
  15133.                      Offset:  UNIV LongInt;
  15134.                      VAR S:    UNIV DisAsmStr80);
  15135.     
  15136.     or in C,
  15137.     
  15138.     pascal void PCRelProc(long Address, char *S)
  15139.     
  15140.     pascal void JTOffProc(short A5JTOffset, char *S)
  15141.     
  15142.     pascal void TrapNameProc(unsigned short TrapWord, char *S)
  15143.     
  15144.     pascal void AbsAddrProc(long AbsAddr, char *S)
  15145.     
  15146.     pascal void IdProc(LookupRegs BaseReg, long Offset, char *S)
  15147.     
  15148.     Note: InitLookup contains initialized data which requires initializing at load
  15149.           time (this is of concern only to users with assembler main programs.
  15150. */
  15151.  
  15152. æKY Lookup
  15153. æFc DisAsmLookup.h
  15154. æT Function
  15155. æD pascal void Lookup(Ptr PC,LookupRegs BaseReg,long Opnd,char *S);
  15156. æDT Lookup((Ptr)PC,(LookupRegs)BaseReg,(long)Opnd,(char *)S);
  15157. æC 
  15158. /* 
  15159.     This is a standard Lookup proc available to the caller for calls to the
  15160.     Disassembler.  If the caller elects to use this proc, then InitLookup MUST be
  15161.     called prior to any calls to the Disassembler.  All the logic to determine the
  15162.     type of lookup is done by this proc.  For PC-relative, Jump Table references,
  15163.     A-traps, absolute addresses, and offsets from a base register, the associated
  15164.     level 1 Pascal proc specified in the InitLookup call (if not NULL) is called.
  15165.     
  15166.     This scheme simplifies the Lookup mechanism by allowing the caller to deal
  15167.     with just the problems related to the application.
  15168. */
  15169.  
  15170.  
  15171. æKY LookupRegs
  15172. _A0_
  15173. _A1_
  15174. _A2_
  15175. _A3_
  15176. _A4_
  15177. _A5_
  15178. _A6_
  15179. _A7_
  15180. _PC_
  15181. _ABS_
  15182. _TRAP_
  15183. æFc DisAsmLookup.h
  15184. æD enum {_A0_,_A1_,_A2_,_A3_,_A4_,_A5_,_A6_,_A7_,_PC_,_ABS_,_TRAP_}LookupRegs;
  15185. typedef unsigned char LookupRegs;
  15186.  
  15187.  
  15188. æKY LookupTrapName
  15189. æFc DisAsmLookup.h
  15190. æT Function
  15191. æD pascal void LookupTrapName(unsigned short TrapWord,char *S);
  15192. æDT LookupTrapName((unsigned short)TrapWord,(char *)S);
  15193. æC 
  15194. /* 
  15195.     This is a procedure provided to allow conversion of a trap instruction (in
  15196.      TrapWord) to its corresponding trap name (in S).  It is provided primarily for
  15197.      use with the Disassembler and its address may be passed to InitLookup above for
  15198.      use by this unit's Lookup routine.  Alternatively, there is nothing prohibiting
  15199.      the caller from using it directly for other purposes or by some other lookup
  15200.      proc.
  15201.     
  15202.     Note: The tables in this proc make the size of this proc about 9500 bytes.  The
  15203.          trap names are fully spelled out in upper and lower case.
  15204. */
  15205.  
  15206.  
  15207. æKY ModifyOperand
  15208. æFc DisAsmLookup.h
  15209. æT Function
  15210. æD pascal void ModifyOperand(char *operand);
  15211. æDT ModifyOperand((char *)operand);
  15212. æC 
  15213. /* 
  15214.     Scan an operand string, i.e., the null terminated Pascal string returned by
  15215.     the Disassembler (null MUST be present here) and modify negative hex values to
  15216.     negated positive value. For example, $FFFF(A5) would be modified to -$0001(A5).
  15217.     The operand to be processed is  passed as the function's parameter which is
  15218.     edited "in place" and returned to the caller.
  15219.     
  15220.     This routine is essentially a pattern matcher and attempts to only modify 2, 4,
  15221.     and 8 digit hex strings in the operand that "might" be offsets from a base
  15222.     register.  If the matching tests are passed, the same number of original digits
  15223.     are output (because that indicates a value's size -- byte, word, or long).
  15224.     
  15225.     For a hex string to be modified, the following tests must be passed:
  15226.     
  15227.     • There must have been exactly 2, 4, or 8 digits.
  15228.     
  15229.       Only hex strings $XX, $XXXX, and $XXXXXXXX are possible candidates because
  15230.       that is the only way the Disassembler generates offsets.
  15231.     
  15232.     • Hex string must be delimited by a "(" or a ",".
  15233.     
  15234.       The "(" allows offsets for $XXXX(An,...) and $XX(An,Xn) addressing modes.
  15235.       The comma allows for the MC68020 addressing forms.
  15236.     
  15237.     • The "$X..." must NOT be preceded by a "±".
  15238.     
  15239.       This eliminates the possibility of modifying the offset of a PC-relative
  15240.       addressing mode always generated in the form "*±$XXXX".
  15241.     
  15242.     • The "$X..." must NOT be preceded by a "#".
  15243.     
  15244.       This eliminates modifying immediate data.
  15245.     
  15246.     • Value must be negative.
  15247.     
  15248.       Negative values are the only values we modify.  A value $FFFF is modified to
  15249.       -$0001.
  15250. */
  15251.  
  15252.  
  15253. æKY showMacsBugSymbol
  15254. æFc DisAsmLookup.h
  15255. æT Function
  15256. æD char *showMacsBugSymbol(char *symStart,void *limit,char *operand,short *bytesUsed);
  15257. æDT char myVariable = showMacsBugSymbol((char *)symStart,(void *)limit,(char *)operand,
  15258.     (short *)bytesUsed);
  15259. æC 
  15260. /* 
  15261.     Format a MacsBug symbol as a operand of a DC.B directive.  The first one or two
  15262.     bytes of the symbol are generated as $80+'c' if they have there high high bits
  15263.     set.  All other characters are shown as characters in a string constant.  The
  15264.     pad byte, if present, is one is also shown as $00.
  15265.     
  15266.     This routine is called to check that the bytes pointed to by symStart represent
  15267.     a valid MacsBug symbol.  The symbol must be fully contained in the bytes
  15268.     starting at symStart, up to, but not including the byte pointed to by the limit
  15269.     parameter.
  15270.     
  15271.     When called, showMacsBugSymbol assumes that symStart is pointing at a valid
  15272.     MacsBug symbol as validated by the validMacsBugSymbol or endOfModule routines.
  15273.     As with validMacsBugSymbol, the symbol must be fully contained in the bytes
  15274.     starting at symStart up to, but not including, the byte pointed to by the end
  15275.     parameter.
  15276.     
  15277.     The string is returned in the 'operand' parameter as a null terminated Pascal
  15278.     string.  The function also returns a pointer to this string as its return
  15279.     value (NULL is returned only if the byte pointed to by the limit parameter is
  15280.     reached prior to processing the entire symbol -- which should not happen if
  15281.     properly validated).  The number of bytes used for the symbol is returned in
  15282.     bytesUsed.  Due to the way MacsBug symbols are encoded, bytesUsed may not
  15283.     necessarily be the same as the length of the operand string.
  15284.     
  15285.     A valid MacsBug symbol consists of the characters '_', '%', spaces, digits, and
  15286.     upper/lower case letters in a format determined by the first two bytes of the
  15287.     symbol as described in the validMacsBugSymbol routine.
  15288.     
  15289. */
  15290.  
  15291. æKY validMacsBugSymbol
  15292. æFc DisAsmLookup.h
  15293. æT Function
  15294. æD char *validMacsBugSymbol(char *symStart,void *limit,char *symbol);
  15295. æDT char myVariable = validMacsBugSymbol((char *)symStart,(void *)limit,
  15296.     (char *)symbol);
  15297. æC 
  15298. /* 
  15299.     Check that the bytes pointed to by symStart represents a valid MacsBug symbol.
  15300.     The symbol must be fully contained in the bytes starting at symStart, up to,
  15301.     but not including, the byte pointed to by the limit parameter.
  15302.     
  15303.     If a valid symbol is NOT found, then NULL is returned as the function's result.
  15304.     However, if a valid symbol is found, it is copied to symbol (if it is not NULL)
  15305.     as a null terminated Pascal string, and return a pointer to where we think the
  15306.     FOLLOWING module begins. In the "old style" cases (see below) this will always
  15307.     be 8 or 16 bytes after the input symStart.  For new style Apple Pascal and C
  15308.     cases this will depend on the symbol length, existence of a pad byte, and size
  15309.     of the constant (literal) area.  In all cases, trailing blanks are removed from
  15310.     the symbol.
  15311.     
  15312.     A valid MacsBug symbol consists of the characters '_', '%', spaces, digits, and
  15313.     upper/lower case letters in a format determined by the first two bytes of the
  15314.     symbol as follows:
  15315.     
  15316.      1st byte  | 2nd byte  |  Byte  |
  15317.        Range   |  Range    | Length | Comments
  15318.     ==============================================================================
  15319.      $20 - $7F | $20 - $7F |    8   | "Old style" MacsBug symbol format
  15320.      $A0 - $FF | $20 - $7F |    8   | "Old style" MacsBug symbol format
  15321.     ------------------------------------------------------------------------------
  15322.      $20 - $7F | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  15323.      $A0 - $FF | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  15324.     ------------------------------------------------------------------------------
  15325.      $80       | $01 - $FF |    n   | n = 2nd byte       (Apple Compiler symbol)
  15326.      $81 - $9F | $00 - $FF |    m   | m = 1st byte & $7F (Apple Compiler symbol)
  15327.     ==============================================================================
  15328.     
  15329.     The formats are determined by whether bit 7 is set in the first and second
  15330.     bytes.  This bit will removed when we find it or'ed into the first and/or
  15331.     second valid symbol characters.
  15332.     
  15333.     The first two formats in the above table are the basic "old style" (pre-
  15334.     existing) MacsBug formats. The first byte may or may not have bit 7 set the
  15335.     second byte is a valid symbol character.  The first byte (with bit 7 removed)
  15336.     and the next 7 bytes are assumed to comprise the symbol.
  15337.     
  15338.     The second pair of formats are also "old style" formats, but used for MacApp
  15339.     symbols.  Bit 7 set in the second character indicates these formats. The symbol
  15340.     is assumed to be 16 bytes with the second 8 bytes preceding the first 8 bytes
  15341.     in the generated symbol.  For example, 12345678abcdefgh represents the symbol
  15342.     abcdefgh.12345678.
  15343.     
  15344.     The last pair of formats are reserved by Apple and generated by the MPW Pascal
  15345.     and C compilers.  In these cases the value of the first byte is always between
  15346.     $80 and $9F, or with bit 7 removed, between $00 and $1F.  For $00, the second
  15347.     byte is the length of the symbol with that many bytes following the second
  15348.     byte (thus a max length of 255). Values $01 to $1F represent the length itself.
  15349.     A pad byte may follow these variable length cases if the symbol does not end
  15350.     on a word boundary.  Following the symbol and the possible pad byte is a word
  15351.     containing the size of the constants (literals) generated by the compiler.
  15352.     
  15353.     Note that if symStart actually does point to a valid MacsBug symbol, then you
  15354.     may use showMacsBugSymbol to convert the MacsBug symbol bytes to a string that
  15355.     could be used as a DC.B operand for disassembly purposes.  This string
  15356.     explicitly shows the MacsBug symbol encodings.
  15357. */
  15358.  
  15359.  
  15360. æKY DiskInit.h
  15361. æKL DIBadMount
  15362. dibadmount
  15363. DIFormat
  15364. DILoad
  15365. DIUnload
  15366. DIVerify
  15367. dizero
  15368. DIZero
  15369.  
  15370. HFSDefaults
  15371.  
  15372. æKY HFSDefaults
  15373. æFc DiskInit.h
  15374. æT struct
  15375. æD struct HFSDefaults {
  15376.     char sigWord[2]; /* signature word*/
  15377.     long abSize; /* allocation block size in bytes*/
  15378.     long clpSize; /* clump size in bytes*/
  15379.     long nxFreeFN; /* next free file number*/
  15380.     long btClpSize; /* B-Tree clump size in bytes*/
  15381.     short rsrv1; /* reserved*/
  15382.     short rsrv2; /* reserved*/
  15383.     short rsrv3; /* reserved*/
  15384. };
  15385.  
  15386. typedef struct HFSDefaults HFSDefaults;
  15387. æC 
  15388. »Formatting Hierarchical Volumes
  15389.  
  15390. The Disk Initialization Package must set certain volume characteristics when placing
  15391. a hierarchical file directory on a volume. Default values for these volume characteristics
  15392. are stored in the 128K ROM; this section is for advanced programmers who want to
  15393. substitute their own values. The record containing the default values, if defined in
  15394. Pascal, would look like this:
  15395.  
  15396. TYPE  HFSDefaults = PACKED RECORD
  15397.                       sigWord:    ARRAY[1..2] OF CHAR;    {signature word}
  15398.                       abSize:     LONGINT;    {allocation block size in bytes}
  15399.                       clpSize:    LONGINT;    {clump size in bytes}
  15400.                       nxFreeFN:   LONGINT;    {next free file number}
  15401.                       btClpSize:  LONGINT;    {B*-Tree clump size in bytes}
  15402.                       rsrv1:      INTEGER;    {reserved}
  15403.                       rsrv2:      INTEGER;    {reserved}
  15404.                       rsrv3:      INTEGER;    {reserved}
  15405.                     END;
  15406.  
  15407. The default values for these fields are as follows:
  15408.  
  15409.   Field    Default value
  15410.  
  15411.   sigWord     'BD'
  15412.   abSize       0
  15413.   clpSize      4 * abSize
  15414.   nxFreeFN    16
  15415.   btClpSize    0
  15416.  
  15417. To supply your own values for these fields, create a similar, nonrelocatable record
  15418. containing the desired values and place a pointer to it in the global variable FmtDefaults.
  15419. To restore the system defaults, simply clear FmtDefaults.
  15420.  
  15421. The sigWord must equal 'BD' (meaning “big disk”) for the volume to be recognized as a
  15422. hierarchical volume. If the specified allocation block size is 0, the allocation
  15423. block size is calculated according to the size of the volume:
  15424.  
  15425.   abSize = (1 + (volSize in blocks / 64K)) * 512 bytes
  15426.  
  15427. If the specified B*-tree clump size is 0, the clump size for both the catalog and
  15428. extent trees is calculated according to the size of the volume:
  15429.  
  15430.   btClpSize = (volSize in blocks)/128 * 512bytes
  15431.  
  15432. æKY DILoad
  15433. æFc DiskInit.h
  15434. æT Function
  15435. æD pascal void DILoad(void); 
  15436. æDT DILoad()(void);
  15437. æMM
  15438. æRI II-396
  15439. æC 
  15440. Assembly-language note:  The trap macro for the Disk Initialization Package
  15441.                          is _Pack2. The routine selectors are as follows:
  15442.  
  15443.                            diBadMount  .EQU    0
  15444.                            diLoad      .EQU    2
  15445.                            diUnload    .EQU    4
  15446.                            diFormat    .EQU    6
  15447.                            diVerify    .EQU    8
  15448.                            diZero      .EQU    10
  15449.  
  15450. DILoad reads the Disk Initialization Package, and its associated dialog and dialog
  15451. items, from the system resource file into memory and makes them unpurgeable.
  15452.  
  15453. Note:  DIFormat, DIVerify, and DIZero don’t need the dialog, so if you use
  15454.        only these routines you can call the Resource Manager function
  15455.        GetResource to read just the package resource into memory (and
  15456.        the Memory Manager procedure HNoPurge to make it unpurgeable).
  15457.  
  15458. æKY DIUnload
  15459. æFc DiskInit.h
  15460. æT Function
  15461. æD pascal void DIUnload(void); 
  15462. æDT DIUnload()(void);
  15463. æMM
  15464. æRI II-396
  15465. æC  
  15466. Assembly-language note:  The trap macro for the Disk Initialization Package
  15467.                          is _Pack2. The routine selectors are as follows:
  15468.  
  15469.                            diBadMount  .EQU    0
  15470.                            diLoad      .EQU    2
  15471.                            diUnload    .EQU    4
  15472.                            diFormat    .EQU    6
  15473.                            diVerify    .EQU    8
  15474.                            diZero      .EQU    10
  15475.  
  15476. DIUnload makes the Disk Initialization Package (and its associated dialog and dialog
  15477. items) purgeable.
  15478.  
  15479. æKY DIBadMount
  15480. æFc DiskInit.h
  15481. æT Function
  15482. æD pascal short DIBadMount(Point where,long evtMessage); 
  15483. æDT short myVariable = DIBadMount((Point) where,(long) evtMessage);
  15484. æRI DIBadMount function  II-396, N70-1, P-34, 168
  15485.  
  15486. æC 
  15487. Assembly-language note:  The trap macro for the Disk Initialization Package
  15488.                          is _Pack2. The routine selectors are as follows:
  15489.  
  15490.                            diBadMount  .EQU    0
  15491.                            diLoad      .EQU    2
  15492.                            diUnload    .EQU    4
  15493.                            diFormat    .EQU    6
  15494.                            diVerify    .EQU    8
  15495.                            diZero      .EQU    10
  15496.  
  15497. Call DIBadMount when a disk-inserted event occurs if the result code in the high-order
  15498. word of the associated event message indicates an error (that is, the result code is
  15499. other than noErr). Given the event message in evtMessage, DIBadMount evaluates the
  15500. result code and either ejects the disk or lets the user initialize and name it. The
  15501. low-order word of the event message contains the drive number. The where parameter
  15502. specifies the location (in global coordinates) of the top left corner of the dialog
  15503. box displayed by DIBadMount.
  15504.  
  15505. If the result code passed is extFSErr, memFullErr, nsDrvErr, paramErr, or volOnLinErr,
  15506. DIBadMount simply ejects the disk from the drive and returns the result code. If the
  15507. result code ioErr, badMDBErr, or noMacDskErr is passed, the error can be corrected by
  15508. initializing the disk; DIBadMount displays a dialog box that describes the problem
  15509. and asks whether the user wants to initialize the disk. For the result code ioErr,
  15510. the dialog box shown in Figure 1 is displayed. (This happens if the disk is brand
  15511. new.) For badMDBErr and noMacDskErr, DIBadMount displays a similar dialog box in
  15512. which the description of the problem is “This disk is damaged” and “This is not a
  15513. Macintosh disk”, respectively.
  15514.  
  15515. •••Refer to Figure 1.•••
  15516.  
  15517. Figure 1–Disk Initialization Dialog for IOErr
  15518.  
  15519. Note:  Before presenting the disk initialization dialog, DIBadMount checks
  15520.        whether the drive contains an already mounted volume; if so, it ejects
  15521.        the disk and returns 2 as its result. This will happen rarely and may
  15522.        reflect an error in your program (for example, you forgot to call
  15523.        DILoad and the user had to switch to the disk containing the system
  15524.        resource file).
  15525.  
  15526. If the user responds to the disk initialization dialog by clicking the Eject button,
  15527. DIBadMount ejects the disk and returns 1 as its result. If the Initialize button is
  15528. clicked, a box displaying the message “Initializing
  15529. disk...” appears, and DIBadMount attempts to initialize the disk. If initialization
  15530. fails, the disk is ejected and the user is informed as shown in Figure 2; after the
  15531. user clicks OK, DIBadMount returns a negative result code ranging from firstDskErr to
  15532. lastDskErr, indicating that a low-level disk error occurred.
  15533.  
  15534. •••Refer to Figure 2.•••
  15535.  
  15536. Figure 2–Initialization Failure Dialog
  15537.  
  15538. If the disk is successfully initialized, the dialog box in Figure 3 appears. After
  15539. the user names the disk and clicks OK, DIBadMount mounts the volume by calling the
  15540. File Manager function MountVol and returns MountVol’s result code
  15541. (noErr if no error occurs).
  15542.  
  15543. •••Refer to Figure 3.•••
  15544.  
  15545. Figure 3–Dialog for Naming a Disk
  15546.  
  15547. Result codes    noErr               No error
  15548.                 extFSErr            External file system
  15549.                 memFullErr          Not enough room in heap zone
  15550.                 nsDrvErr            No such drive
  15551.                 paramErr            Bad drive number
  15552.                 volOnLinErr         Volume already on-line
  15553.                 firstDskErr         Low-level disk error
  15554.                 through lastDskErr
  15555.  
  15556. Other results   1                   User clicked Eject
  15557.                 2                   Mounted volume in drive
  15558.  
  15559. æKY dibadmount
  15560. æFc DiskInit.h
  15561. æT Function
  15562. æD OSErr dibadmount(Point *where,long evtMessage); 
  15563. æDT OSErr myVariable = dibadmount((Point *) where,(long) evtMessage);
  15564. æC 
  15565. Assembly-language note:  The trap macro for the Disk Initialization Package
  15566.                          is _Pack2. The routine selectors are as follows:
  15567.  
  15568.                            diBadMount  .EQU    0
  15569.                            diLoad      .EQU    2
  15570.                            diUnload    .EQU    4
  15571.                            diFormat    .EQU    6
  15572.                            diVerify    .EQU    8
  15573.                            diZero      .EQU    10
  15574.  
  15575. Call DIBadMount when a disk-inserted event occurs if the result code in the high-order
  15576. word of the associated event message indicates an error (that is, the result code is
  15577. other than noErr). Given the event message in evtMessage, DIBadMount evaluates the
  15578. result code and either ejects the disk or lets the user initialize and name it. The
  15579. low-order word of the event message contains the drive number. The where parameter
  15580. specifies the location (in global coordinates) of the top left corner of the dialog
  15581. box displayed by DIBadMount.
  15582.  
  15583. If the result code passed is extFSErr, memFullErr, nsDrvErr, paramErr, or volOnLinErr,
  15584. DIBadMount simply ejects the disk from the drive and returns the result code. If the
  15585. result code ioErr, badMDBErr, or noMacDskErr is passed, the error can be corrected by
  15586. initializing the disk; DIBadMount displays a dialog box that describes the problem
  15587. and asks whether the user wants to initialize the disk. For the result code ioErr,
  15588. the dialog box shown in Figure 1 is displayed. (This happens if the disk is brand
  15589. new.) For badMDBErr and noMacDskErr, DIBadMount displays a similar dialog box in
  15590. which the description of the problem is “This disk is damaged” and “This is not a
  15591. Macintosh disk”, respectively.
  15592.  
  15593. •••Refer to Figure 1.•••
  15594.  
  15595. Figure 1–Disk Initialization Dialog for IOErr
  15596.  
  15597. Note:  Before presenting the disk initialization dialog, DIBadMount checks
  15598.        whether the drive contains an already mounted volume; if so, it ejects
  15599.        the disk and returns 2 as its result. This will happen rarely and may
  15600.        reflect an error in your program (for example, you forgot to call
  15601.        DILoad and the user had to switch to the disk containing the system
  15602.        resource file).
  15603.  
  15604. If the user responds to the disk initialization dialog by clicking the Eject button,
  15605. DIBadMount ejects the disk and returns 1 as its result. If the Initialize button is
  15606. clicked, a box displaying the message “Initializing
  15607. disk...” appears, and DIBadMount attempts to initialize the disk. If initialization
  15608. fails, the disk is ejected and the user is informed as shown in Figure 2; after the
  15609. user clicks OK, DIBadMount returns a negative result code ranging from firstDskErr to
  15610. lastDskErr, indicating that a low-level disk error occurred.
  15611.  
  15612. •••Refer to Figure 2.•••
  15613.  
  15614. Figure 2–Initialization Failure Dialog
  15615.  
  15616. If the disk is successfully initialized, the dialog box in Figure 3 appears. After
  15617. the user names the disk and clicks OK, DIBadMount mounts the volume by calling the
  15618. File Manager function MountVol and returns MountVol’s result code
  15619. (noErr if no error occurs).
  15620.  
  15621. •••Refer to Figure 3.•••
  15622.  
  15623. Figure 3–Dialog for Naming a Disk
  15624.  
  15625. Result codes    noErr               No error
  15626.                 extFSErr            External file system
  15627.                 memFullErr          Not enough room in heap zone
  15628.                 nsDrvErr            No such drive
  15629.                 paramErr            Bad drive number
  15630.                 volOnLinErr         Volume already on-line
  15631.                 firstDskErr         Low-level disk error
  15632.                 through lastDskErr
  15633.  
  15634. Other results   1                   User clicked Eject
  15635.                 2                   Mounted volume in drive
  15636.  
  15637. æKY DIFormat
  15638. æFc DiskInit.h
  15639. æT Function
  15640. æD pascal OSErr DIFormat(short drvNum); 
  15641. æDT OSErr myVariable = DIFormat((short) drvNum);
  15642. æMM
  15643. æRI II-398
  15644. æC 
  15645. Assembly-language note:  The trap macro for the Disk Initialization Package
  15646.                          is _Pack2. The routine selectors are as follows:
  15647.  
  15648.                            diBadMount  .EQU    0
  15649.                            diLoad      .EQU    2
  15650.                            diUnload    .EQU    4
  15651.                            diFormat    .EQU    6
  15652.                            diVerify    .EQU    8
  15653.                            diZero      .EQU    10
  15654.  
  15655. DIFormat formats the disk in the drive specified by the given drive number and returns
  15656. a result code indicating whether the formatting was completed successfully or failed.
  15657. Formatting a disk consists of writing special information onto it so that the Disk
  15658. Driver can read from and write to the disk.
  15659.  
  15660. Result codes    noErr               No error
  15661.                 firstDskErr         Low-level disk error
  15662.                 through lastDskErr
  15663.  
  15664. æKY DIVerify
  15665. æFc DiskInit.h
  15666. æT Function
  15667. æD pascal OSErr DIVerify(short drvNum); 
  15668. æDT OSErr myVariable = DIVerify((short) drvNum);
  15669. æMM
  15670. æRI II-398
  15671. æC 
  15672. Assembly-language note:  The trap macro for the Disk Initialization Package
  15673.                          is _Pack2. The routine selectors are as follows:
  15674.  
  15675.                            diBadMount  .EQU    0
  15676.                            diLoad      .EQU    2
  15677.                            diUnload    .EQU    4
  15678.                            diFormat    .EQU    6
  15679.                            diVerify    .EQU    8
  15680.                            diZero      .EQU    10
  15681.  
  15682. DIVerify verifies the format of the disk in the drive specified by the given drive
  15683. number; it reads each bit from the disk and returns a result code indicating whether
  15684. all bits were read successfully or not. DIVerify doesn’t affect the contents of the
  15685. disk itself.
  15686.  
  15687. Result codes    noErr               No error
  15688.                 firstDskErr         Low-level disk error
  15689.                 through lastDskErr
  15690.  
  15691. æKY DIZero
  15692. æFc DiskInit.h
  15693. æT Function
  15694. æD pascal OSErr DIZero(short drvNum,const Str255 volName); 
  15695. æDT OSErr myVariable = DIZero((short) drvNum,(const Str255) volName);
  15696. æMM
  15697. æRT 70
  15698. æRI II-399, N70-2
  15699. æC 
  15700. Assembly-language note:  The trap macro for the Disk Initialization Package
  15701.                          is _Pack2. The routine selectors are as follows:
  15702.  
  15703.                            diBadMount  .EQU    0
  15704.                            diLoad      .EQU    2
  15705.                            diUnload    .EQU    4
  15706.                            diFormat    .EQU    6
  15707.                            diVerify    .EQU    8
  15708.                            diZero      .EQU    10
  15709.  
  15710. On the unmounted volume in the drive specified by the given drive number, DIZero
  15711. writes the volume information, a block map, and a file directory as for a volume with
  15712. no files; the volName parameter specifies the volume name to be included in the
  15713. volume information. This is the last step in initialization
  15714. (after formatting and verifying) and makes any files that are already on the volume
  15715. permanently inaccessible. If the operation fails, DIZero returns a result code indicating
  15716. that a low-level disk error occurred; otherwise, it mounts the volume by calling the
  15717. File Manager function MountVol and returns MountVol’s result code (noErr if no error
  15718. occurs).
  15719.  
  15720. Result codes    noErr              No error
  15721.                 badMDBErr          Bad master directory block
  15722.                 extFSErr           External file system
  15723.                 ioErr              I/O error
  15724.                 memFullErr         Not enough room in heap zone
  15725.                 noMacDskErr        Not a Macintosh disk
  15726.                 nsDrvErr           No such drive
  15727.                 paramErr           Bad drive number
  15728.                 volOnLinErr        Volume already on-line
  15729.                 firstDskErr        Low-level disk error
  15730.                 through lastDskErr
  15731.  
  15732. æKY dizero
  15733. æFc DiskInit.h
  15734. æT Function
  15735. æD OSErr dizero(short drvnum,char *volName); 
  15736. æDT OSErr myVariable = dizero((short) drvnum,(char *) volName);
  15737. æC 
  15738.  
  15739.  
  15740. æKY Disks.h
  15741. æKL DiskEject
  15742. DriveStatus
  15743. SetTagBuffer
  15744.  
  15745. DrvSts
  15746. DrvSts2
  15747.  
  15748. æKY DrvSts
  15749. æFc Disks.h
  15750. æT struct
  15751. æD struct DrvSts {
  15752.     short track;
  15753.     char writeProt;
  15754.     char diskInPlace;
  15755.     char installed;
  15756.     char sides;
  15757.     QElemPtr qLink;
  15758.     short qType;
  15759.     short dQDrive;
  15760.     short dQRefNum;
  15761.     short dQFSID;
  15762.     char twoSideFmt;
  15763.     char needsFlush;
  15764.     short diskErrs;
  15765. };
  15766.  
  15767. typedef struct DrvSts DrvSts;
  15768. æC 
  15769.  
  15770. æKY DrvSts2
  15771. æFc Disks.h
  15772. æT struct
  15773. æD struct DrvSts2 {
  15774.     short track;
  15775.     char writeProt;
  15776.     char diskInPlace;
  15777.     char installed;
  15778.     char sides;
  15779.     QElemPtr qLink;
  15780.     short qType;
  15781.     short dQDrive;
  15782.     short dQRefNum;
  15783.     short dQFSID;
  15784.     short driveSize;
  15785.     short driveS1;
  15786.     short driveType;
  15787.     short driveManf;
  15788.     short driveChar;
  15789.     char driveMisc;
  15790. };
  15791.  
  15792. typedef struct DrvSts2 DrvSts2;
  15793. æC 
  15794.  
  15795. æKY DiskEject
  15796. æFc Disks.h
  15797. æT Function
  15798. æD pascal OSErr DiskEject(short drvNum); 
  15799. æDT OSErr myVariable = DiskEject((short) drvNum);
  15800. æMM
  15801. æRI II-214
  15802. æC 
  15803. [Not in ROM]
  15804.  
  15805. Assembly-language note:  DiskEject is equivalent to a Control call with
  15806.                          csCode equal to the global constant ejectCode.
  15807.  
  15808. DiskEject ejects the disk from the internal drive if drvNum is 1, or from the external
  15809. drive if drvNum is 2.
  15810.  
  15811. Result codes    noErr       No error
  15812.                 nsDrvErr    No such drive
  15813.  
  15814. æKY SetTagBuffer
  15815. æFc Disks.h
  15816. æT Function
  15817. æD pascal OSErr SetTagBuffer(Ptr buffPtr); 
  15818. æDT OSErr myVariable = SetTagBuffer((Ptr) buffPtr);
  15819. æMM
  15820. æRI II-214
  15821. æC 
  15822. [Not in ROM]
  15823.  
  15824. Assembly-language note:  SetTagBuffer is equivalent to a Control call with
  15825.                          csCode equal to the global constant tgBuffCode.
  15826.  
  15827. An application can change the information used in the file tags buffer by calling
  15828. SetTagBuffer. The buffPtr parameter points to a buffer that contains the information
  15829. to be used. If buffPtr is NIL, the information in the file tags buffer isn’t changed.
  15830.  
  15831. If buffPtr isn’t NIL, every time the Disk Driver reads a sector from the disk, it
  15832. stores the file tags in the file tags buffer and in the buffer pointed to by buffPtr.
  15833. Every time the Disk Driver writes a sector onto the disk, it reads 12 bytes from the
  15834. buffer pointed to by buffPtr, places them in the file tags buffer, and then writes
  15835. them onto the disk.
  15836.  
  15837. The contents of the buffer pointed to by buffPtr are overwritten at the end of every
  15838. read request (which can be composed of a number of sectors) instead of at the end of
  15839. every sector. Each read request places 12 bytes in the buffer for each sector, always
  15840. beginning at the start of the buffer. This way an application can examine the file
  15841. tags for a number of sequentially read sectors. If a read request is composed of a
  15842. number of sectors, the Disk Driver places 12 bytes in the buffer for each sector. For
  15843. example, for a read request of five sectors, the Disk Driver will place 60 bytes in
  15844. the buffer.
  15845.  
  15846. Result codes    noErr    No error
  15847.  
  15848. æKY DriveStatus
  15849. æFc Disks.h
  15850. æT Function
  15851. æD pascal OSErr DriveStatus(short drvNum,DrvSts *status); 
  15852. æDT OSErr myVariable = DriveStatus((short) drvNum,(DrvSts *) status);
  15853. æMM
  15854. æRI II-215
  15855. æC 
  15856. [Not in ROM]
  15857.  
  15858. Assembly-language note:  DriveStatus is equivalent to a Status call with
  15859.                          csCode equal to the global constant drvStsCode;
  15860.                          status is returned in csParam through csParam+21.
  15861.  
  15862. DriveStatus returns information about the internal drive if drvNum is 1, or about the
  15863. external drive if drvNum is 2. The information is returned in a record of type DrvSts:
  15864.  
  15865. TYPE  DrvSts = RECORD
  15866.                  track:        INTEGER;     {current track}
  15867.                  writeProt:    SignedByte;  {bit 7=1 if volume is locked}
  15868.                  diskInPlace:  SignedByte;  {disk in place}
  15869.                  installed:    SignedByte;  {drive installed}
  15870.                  sides:        SignedByte;  {bit 7=0 if single-side drive}
  15871.                  qLink:        QElemPtr;    {next queue entry}
  15872.                  qType:        INTEGER;     {reserved for future use}
  15873.                  dQDrive:      INTEGER;     {drive number}
  15874.                  dQRefNum:     INTEGER;     {driver reference number}
  15875.                  dQFSID:       INTEGER;     {file-system identifier}
  15876.                  twoSideFmt:   SignedByte;  {-1 if two-sided disk}
  15877.                  needsFlush:   SignedByte;  {reserved for future use}
  15878.                  diskErrs:     INTEGER      {error count}
  15879.                END;
  15880.  
  15881. The diskInPlace field is 0 if there’s no disk in the drive, 1 or 2 if there is a disk
  15882. in the drive, or –4 to –1 if the disk was ejected in the last 1.5 seconds. The installed
  15883. field is 1 if the drive is connected to the Macintosh, 0 if the drive might be connected
  15884. to the Macintosh, and –1 if the drive isn’t installed. The value of twoSideFmt is
  15885. valid only when diskInPlace=2. The value of diskErrs is incremented every time an
  15886. error occurs internally within the Disk Driver.
  15887.  
  15888. Result codes    noErr       No error
  15889.                 nsDrvErr    No such drive
  15890.  
  15891.  
  15892. æKY Editions.h
  15893. æKL AssociateSection
  15894. CallEditionOpenerProc
  15895. CallFormatIOProc
  15896. CloseEdition
  15897. CreateEditionContainerFile
  15898. DeleteEditionContainerFile
  15899. EditionHasFormat
  15900. FindEditionContainerDialog
  15901. GetEditionFormatMark
  15902. GetEditionInfo
  15903. GetEditionOpenerProc
  15904. GetLastEditionContainerUsed
  15905. GetStandardFormats
  15906. GotoPublisherSection
  15907. InitEditionPack
  15908. IsRegisterSection
  15909. NewPublisherDialog
  15910. NewPublisherExpDialog
  15911. NewSection
  15912. NewSubscriberDialog
  15913. NewSubscriberExpDialog
  15914. OpenEdition
  15915. OpenNewEdition
  15916. ReadEdition
  15917. RegisterSection
  15918. SectionOptionsDialog
  15919. SectionOptionsExpDialog
  15920. SetEditionFormatMark
  15921. SetEditionOpenerProc
  15922. UnRegisterSection
  15923. WriteEdition
  15924.  
  15925. EditionContainerSpec
  15926. EditionInfoRecord
  15927. EditionOpenerParamBlock
  15928. EditionOpenerProcPtr
  15929. EditionOpenerVerb
  15930. EditionRefNum
  15931. eoCanSubscribe
  15932. eoClose
  15933. eoCloseNew
  15934. eoOpen
  15935. eoOpenNew
  15936. ExpDlgHookProcPtr
  15937. ExpModalFilterProcPtr
  15938. FormatIOParamBlock
  15939. FormatIOProcPtr
  15940. FormatIOVerb
  15941. FormatType
  15942. ioHasFormat
  15943. ioNewFormat
  15944. ioReadFormat
  15945. ioWriteFormat
  15946. kFormatLengthUnknown
  15947. kFormatListFormat
  15948. kPartNumberUnknown
  15949. kPartsNotUsed
  15950. kPreviewFormat
  15951. kPreviewHeight
  15952. kPreviewWidth
  15953. kPublisherDocAliasFormat
  15954. NewPublisherReply
  15955. NewSubscriberReply
  15956. pumOnSave
  15957. pumSuspend
  15958. rSectionType
  15959. sectionCancelMsgID
  15960. sectionEventMsgClass
  15961. SectionHandle
  15962. SectionOptionsReply
  15963. SectionPtr
  15964. sectionReadMsgID
  15965. SectionRecord
  15966. sectionScrollMsgID
  15967. SectionType
  15968. sectionWriteMsgID
  15969. stPublisher
  15970. stSubscriber
  15971. sumAutomatic
  15972. sumOnRequestOnly
  15973. TimeStamp
  15974. UpdateMode
  15975.  
  15976. æKY rSectionType
  15977. æFc Editions.h
  15978. æT #define
  15979. æD 
  15980. /*  resource types  */
  15981.  
  15982. #define rSectionType 'sect' /* ResType of saved SectionRecords */
  15983. æC 
  15984.  
  15985. æKY stSubscriber
  15986. æFc Editions.h
  15987. æT #define
  15988. æD 
  15989. /*  ssection types  */
  15990.  
  15991. #define stSubscriber 0x01
  15992. æC 
  15993.  
  15994. æKY stPublisher
  15995. æFc Editions.h
  15996. æT #define
  15997. æD #define stPublisher 0x0A
  15998. æC 
  15999.  
  16000. æKY sumAutomatic
  16001. æFc Editions.h
  16002. æT #define
  16003. æD 
  16004. /*  update modes  */
  16005.  
  16006. #define sumAutomatic 0 /* subscriber update mode - Automatic        */
  16007. æC 
  16008.  
  16009. æKY sumOnRequestOnly
  16010. æFc Editions.h
  16011. æT #define
  16012. æD #define sumOnRequestOnly 1 /* subscriber update mode - OnRequestOnly    */
  16013. æC 
  16014.  
  16015. æKY pumOnSave
  16016. æFc Editions.h
  16017. æT #define
  16018. æD #define pumOnSave 0 /* publisher update mode - OnSave            */
  16019. æC 
  16020.  
  16021. æKY pumSuspend
  16022. æFc Editions.h
  16023. æT #define
  16024. æD #define pumSuspend 1 /* publisher update mode - OnRequestOnly    */
  16025. æC 
  16026.  
  16027. æKY kPartsNotUsed
  16028. æFc Editions.h
  16029. æT #define
  16030. æD #define kPartsNotUsed 0
  16031. æC 
  16032.  
  16033. æKY kPartNumberUnknown
  16034. æFc Editions.h
  16035. æT #define
  16036. æD #define kPartNumberUnknown (-1)
  16037. æC 
  16038.  
  16039. æKY kPreviewWidth
  16040. æFc Editions.h
  16041. æT #define
  16042. æD #define kPreviewWidth 120
  16043. æC 
  16044.  
  16045. æKY kPreviewHeight
  16046. æFc Editions.h
  16047. æT #define
  16048. æD #define kPreviewHeight 120
  16049. æC 
  16050.  
  16051. æKY kPublisherDocAliasFormat
  16052. æFc Editions.h
  16053. æT #define
  16054. æD #define kPublisherDocAliasFormat 'alis'
  16055. æC 
  16056.  
  16057. æKY kPreviewFormat
  16058. æFc Editions.h
  16059. æT #define
  16060. æD #define kPreviewFormat 'prvw'
  16061. æC 
  16062.  
  16063. æKY kFormatListFormat
  16064. æFc Editions.h
  16065. æT #define
  16066. æD #define kFormatListFormat 'fmts'
  16067. æC 
  16068.  
  16069. æKY kFormatLengthUnknown
  16070. æFc Editions.h
  16071. æT #define
  16072. æD #define kFormatLengthUnknown (-1)
  16073. æC 
  16074.  
  16075. æKY sectionEventMsgClass
  16076. æFc Editions.h
  16077. æT #define
  16078. æD 
  16079. /*  the following fields are private and set up by RegisterSection                    
  16080.  
  16081.     Section events now arrive in the message buffer using the new AppleEvent format.
  16082.     The direct object parameter is an aeTemporaryIDParamType ('tid '). The temporary
  16083.     ID's type is rSectionType ('sect') and the 32-bit value is a SectionHandle.
  16084.  
  16085.  */
  16086.  
  16087. #define sectionEventMsgClass 'sect'
  16088. æC 
  16089.  
  16090. æKY sectionReadMsgID
  16091. æFc Editions.h
  16092. æT #define
  16093. æD #define sectionReadMsgID 'read'
  16094. æC 
  16095.  
  16096. æKY sectionWriteMsgID
  16097. æFc Editions.h
  16098. æT #define
  16099. æD #define sectionWriteMsgID 'writ'
  16100. æC 
  16101.  
  16102. æKY sectionScrollMsgID
  16103. æFc Editions.h
  16104. æT #define
  16105. æD #define sectionScrollMsgID 'scrl'
  16106. æC 
  16107.  
  16108. æKY sectionCancelMsgID
  16109. æFc Editions.h
  16110. æT #define
  16111. æD #define sectionCancelMsgID 'cncl'
  16112. æC 
  16113.  
  16114. æKY FormatIOVerb
  16115. ioHasFormat
  16116. ioReadFormat
  16117. ioNewFormat
  16118. ioWriteFormat
  16119. æFc Editions.h
  16120. æT enum
  16121. æD enum {ioHasFormat,ioReadFormat,ioNewFormat,ioWriteFormat};
  16122. typedef unsigned char FormatIOVerb;
  16123. æC 
  16124.  
  16125. æKY EditionOpenerVerb
  16126. eoOpen
  16127. eoClose
  16128. eoOpenNew
  16129. eoCloseNew
  16130. eoCanSubscribe
  16131.  
  16132. æFc Editions.h
  16133. æT enum
  16134. æD enum {eoOpen,eoClose,eoOpenNew,eoCloseNew,eoCanSubscribe};
  16135. typedef unsigned char EditionOpenerVerb;
  16136. æC 
  16137.  
  16138. æKY UpdateMode
  16139. æFc Editions.h
  16140. æT typedef
  16141. æD typedef short UpdateMode; /* sumAutomatic, pumSuspend, etc */
  16142. æC 
  16143.  
  16144. æKY SectionType
  16145. æFc Editions.h
  16146. æT typedef
  16147. æD typedef char SectionType; /* one byte, stSubscriber or stPublisher */
  16148. æC 
  16149.  
  16150. æKY TimeStamp
  16151. æFc Editions.h
  16152. æT typedef
  16153. æD typedef unsigned long TimeStamp; /* seconds since 1904 */
  16154. æC 
  16155.  
  16156. æKY FormatType
  16157. æFc Editions.h
  16158. æT typedef
  16159. æD typedef unsigned long FormatType; /* similar to ResType */
  16160. æC 
  16161.  
  16162. æKY EditionRefNum
  16163. æFc Editions.h
  16164. æT typedef
  16165. æD typedef Handle EditionRefNum; /* used in Edition I/O */
  16166. æC 
  16167.  
  16168. æKY ExpModalFilterProcPtr
  16169. æFc Editions.h
  16170. æT typedef
  16171. æD typedef pascal Boolean (*ExpModalFilterProcPtr) (DialogPtr theDialog, EventRecord *theEvent,
  16172.  short itemOffset, short *itemHit, Ptr yourDataPtr);
  16173. æC 
  16174.  
  16175. æKY ExpDlgHookProcPtr
  16176. æFc Editions.h
  16177. æT typedef
  16178. æD typedef pascal short (*ExpDlgHookProcPtr) (short itemOffset,
  16179.   short itemHit, DialogPtr theDialog, Ptr yourDataPtr);
  16180. æC 
  16181.  
  16182. æKY FormatIOProcPtr
  16183. æFc Editions.h
  16184. æT typedef
  16185. æD typedef pascal short (*FormatIOProcPtr) (FormatIOVerb selector, FormatIOParamBlock *PB);
  16186. æC 
  16187.  
  16188. æKY EditionOpenerProcPtr
  16189. æFc Editions.h
  16190. æT typedef
  16191. æD typedef pascal short (*EditionOpenerProcPtr) (EditionOpenerVerb selector, FormatIOParamBlock *PB);
  16192. æC 
  16193.  
  16194. æKY SectionRecord
  16195. SectionPtr
  16196. SectionHandle
  16197. æFc Editions.h
  16198. æT struct
  16199. æD struct SectionRecord {
  16200.     signed char version; /* always 0x01 in system 7.0 */
  16201.     SectionType kind; /* stSubscriber or stPublisher */
  16202.     UpdateMode mode; /* auto or manual */
  16203.     TimeStamp mdDate; /* last change in document */
  16204.     long sectionID; /* app. specific, unique per document */
  16205.     long refCon; /* application specific */
  16206.     AliasHandle alias; /* handle to Alias Record */
  16207.     long subPart; /* which part of container file */
  16208.     struct SectionRecord **nextSection; /* for linked list of app's Sections */
  16209.     Handle controlBlock; /* used internally */
  16210.     EdtionRefNum refNum; /* used internally */
  16211. };
  16212.  
  16213. typedef struct SectionRecord SectionRecord;
  16214. typedef SectionRecord *SectionPtr, **SectionHandle;
  16215.  
  16216. æC 
  16217.  
  16218. æKY EditionContainerSpec
  16219. æFc Editions.h
  16220. æT struct
  16221. æD struct EditionContainerSpec {
  16222.     CanonicalFileSpec theFile;
  16223.     Short theFileScript;
  16224.     long thePart;
  16225.     Str31 thePartName;
  16226.     Short thePartScript;
  16227. };
  16228.  
  16229. typedef struct EditionContainerSpec EditionContainerSpec;
  16230. æC 
  16231.  
  16232. æKY EditionInfoRecord
  16233. æFc Editions.h
  16234. æT struct
  16235. æD struct EditionInfoRecord {
  16236.     TimeStamp crDate; /* date EditionContainer was created */
  16237.     TimeStamp mdDate; /* date of last change */
  16238.     OSType fdCreator; /* file creator */
  16239.     OSType fdType; /* file type */
  16240.     EditionContainerSpec container; /* the Edition */
  16241. };
  16242.  
  16243. typedef struct EditionInfoRecord EditionInfoRecord;
  16244. æC 
  16245.  
  16246. æKY NewPublisherReply
  16247. æFc Editions.h
  16248. æT struct
  16249. æD struct NewPublisherReply {
  16250.     Boolean canceled; /* O */
  16251.     Boolean replacing ;
  16252.     Boolean usePart; /* I */
  16253.     Handle preview; /* I */
  16254.     FormatType previewFormat; /* I */
  16255.     EditionContainerSpec container; /* I/O */
  16256. };
  16257.  
  16258. typedef struct NewPublisherReply NewPublisherReply;
  16259. æC 
  16260.  
  16261. æKY NewSubscriberReply
  16262. æFc Editions.h
  16263. æT struct
  16264. æD struct NewSubscriberReply {
  16265.     Boolean canceled; /* O */
  16266.     EditionContainerSpec container; /* I/O */
  16267. };
  16268.  
  16269. typedef struct NewSubscriberReply NewSubscriberReply;
  16270. æC 
  16271.  
  16272. æKY SectionOptionsReply
  16273. æFc Editions.h
  16274. æT struct
  16275. æD struct SectionOptionsReply {
  16276.     Boolean canceled; /* O */
  16277.     Boolean changed; /* O */
  16278.     SectionHandle sectionH; /* I */
  16279.     ResType action; /* O */
  16280. };
  16281.  
  16282. typedef struct SectionOptionsReply SectionOptionsReply;
  16283. æC 
  16284.  
  16285. æKY FormatIOParamBlock
  16286. æFc Editions.h
  16287. æT struct
  16288. æD struct FormatIOParamBlock {
  16289.     long ioRefNum;
  16290.     FormatType format;
  16291.     long formatIndex;
  16292.     unsigned long offset;
  16293.     Ptr buffPtr;
  16294.     unsigned long buffLen;
  16295. };
  16296.  
  16297. typedef struct FormatIOParamBlock FormatIOParamBlock;
  16298. æC 
  16299.  
  16300. æKY EditionOpenerParamBlock
  16301. æFc Editions.h
  16302. æT struct
  16303. æD struct EditionOpenerParamBlock {
  16304.     EditionInfoRecord info;
  16305.     SectionRecord **sectionH;
  16306.     CanonicalFileSpec *document;
  16307.     OSType fdCreator;
  16308.     long ioRefNum;
  16309.     FormatIOProcPtr ioProc;
  16310.     Boolean success;
  16311. };
  16312.  
  16313. typedef struct EditionOpenerParamBlock EditionOpenerParamBlock;
  16314. æC 
  16315.  
  16316. æKY InitEditionPack
  16317. æFc Editions.h
  16318. æT Function
  16319. æTN A82D
  16320. æD pascal OSErr InitEditionPack(void)
  16321.     = {0x3F3C,0x0010,0x303C,0x0100,0xA82D}; 
  16322. æDT OSErr myVariable = InitEditionPack()(void);
  16323. æC 
  16324. You use the InitEditionPack function to initialize the Edition Manager. Before
  16325. calling this funciton, be sure to determine if the Edition Manager is available
  16326. on your system using the Gestalt function.
  16327.  
  16328. The InitEditionPack function returns an error if the pack could not be loaded or
  16329. is an old version. If the InitEditionPack does not return noErr, there is not
  16330. enough system heap to load the package.
  16331.  
  16332. Result codes
  16333. noErr                   0  No error
  16334. editionMgrInitErr    -450  Could not load package
  16335. MemError                   NewHandle errors
  16336. ResError                   GetResource errors
  16337.  
  16338. æKY NewSection
  16339. æFc Editions.h
  16340. æT Function
  16341. æTN A82D
  16342. æD pascal OSErr NewSection(const EditionContinerSpec *container,const CanonicalFileSpec *sectionDocument,
  16343.     SectionType kind,long sectionID,UpdateMode initalMode,SectionHandle *sectionH)
  16344.     = {0x303C,0x0A02,0xA82D}; 
  16345. æDT OSErr myVariable = NewSection((const EditionContinerSpec *) container,(const CanonicalFileSpec *) sectionDocument,()
  16346.     SectionType kind,(long) sectionID,(UpdateMode) initalMode,(SectionHandle *) sectionH);
  16347. æC 
  16348. You use the NewSection routine to create a new section (either publisher or
  16349. subscriber), and alias record from the sectionDocument (document that contains a
  16350. section) to the edition container. The NewSection function allocates two
  16351. handles; one handle for the section record and another handle for the alias
  16352. record.
  16353.  
  16354. The container parameter is the name of the file which holds the edition.The
  16355. sectionDocument parameter is the file name (in canonical form) of the document
  16356. that contains section. The sectionDocument parameter can be NIL if your current
  16357. document has never been saved. If so, remember to call the AssociateSection
  16358. function when the user finally saves the document to update the alias record of
  16359. a registered section.
  16360.  
  16361. The kind parameter designates the type of section (publisher or subscriber)
  16362. being created. 
  16363.  
  16364. Identify the section with a unique number in the sectionID parameter.
  16365.  
  16366. The initialMode parameter contains the update mode for the section. For
  16367. publishers, this is either the constant pumOnSave or pumSuspend and for
  16368. subscribers this is either sumAutomatic or sumOnRequestOnly.
  16369.  
  16370. If the NewSection function fails, the sectionH parameter is set to NIL. If the
  16371. function is successful, sectionH contains the handle to the allocated section
  16372. record.
  16373.  
  16374. Result codes
  16375. noErr                    0  No error
  16376. editionMgrInitErr     -450  Manager not init’ed
  16377. badSubPartErr         -454  Bad container spec
  16378. badSectionErr         -451  Not valid SectionType
  16379. multiplePublisherWrn  -460  Already is a publisher
  16380. MemError                    NewHandle errors
  16381. ???                         NewAlias errors
  16382.  
  16383. The NewSection function internally calls the RegisterSection function to inform
  16384. the Edition Manager about a section.
  16385.  
  16386. æKY RegisterSection
  16387. æFc Editions.h
  16388. æT Function
  16389. æTN A82D
  16390. æD pascal OSErr RegisterSection(const CanonicalFileSpec *sectionDocument,SectionHandle sectionH,
  16391.     Boolean *aliasWasChanged)
  16392.     = {0x303C,0x0604,0xA82D}; 
  16393. æDT OSErr myVariable = RegisterSection((const CanonicalFileSpec *) sectionDocument,(SectionHandle) sectionH,(
  16394.     Boolean) * aliasWasChanged);
  16395. æC 
  16396. The sectionDocument parameter is the file name of the document containing the
  16397. section. This parameter cannot be NIL.
  16398.  
  16399. The aliasWasChanged parameter returns TRUE if the alias for the edition
  16400. container subscribed to is out of date. If so, the RegisterSection function
  16401. updates the alias. This may occur if the file is moved to a new location or is
  16402. renamed.
  16403.  
  16404. The RegisterSection function adds the section record to the Edition Manager’s
  16405. list of registered sections, and allocates a control block. After calling the
  16406. RegisterSection function, the control block is either NIL or a valid control
  16407. block. The control block is NIL if the RegisterSection function cannot locate
  16408. the edition container being subscribed to. The RegisterSection function returns
  16409. containerNotFoundWrn. 
  16410.  
  16411. You can compare control blocks for individual sections. If two sections contain
  16412. the same control block value, these sections subscribe to the same edition. The
  16413. Edition Manager needs to be informed when no sections are referencing a control
  16414. block so that it can be deallocated. The control block maintains a count of how
  16415. many sections are referencing it. Each time you use the UnRegisterSection
  16416. function, the control block removes one from the number of sections. When the
  16417. number of sections reaches 0, the control block is deallocated.
  16418.  
  16419. For each section that you cannot register, you should display the document on
  16420. the user’s screen, scroll to the location of the section, and then call the
  16421. FindEditionContainerDialog function.
  16422.  
  16423. Result codes
  16424. noErr                    0  No error
  16425. editionMgrInitErr     -450  Manager not init’ed
  16426. badSectionErr         -451  Not valid SectionType
  16427. multiplePublisherWrn  -460  Already is a publisher
  16428. containerNotFoundWrn  -461  Alias was not resolved
  16429. ???                         MatchAlias errors
  16430.  
  16431. æKY UnRegisterSection
  16432. æFc Editions.h
  16433. æT Function
  16434. æTN A82D
  16435. æD pascal OSErr UnRegisterSection(SectionHandle sectionH)
  16436.     = {0x303C,0x0206,0xA82D}; 
  16437. æDT OSErr myVariable = UnRegisterSection((SectionHandle) sectionH);
  16438. æC 
  16439. When a section needs to be disposed of because the document containing the
  16440. section is closing, or the user is canceling the section, you need to call the
  16441. UnRegisterSection function.
  16442.  
  16443. The sectionH parameter is a handle to the section record for a given section.
  16444.  
  16445. The UnRegisterSection function removes the section from the application’s list
  16446. of registered sections. You can then dispose of the section record and alias
  16447. record with standard memory and resource manager calls. Once unregistered, a
  16448. section does not received any events and cannot read or write any data.
  16449. Depending on your clipboard strategy, you may want to unregister sections that
  16450. have been cut into the clipboard.
  16451.  
  16452. Result codes
  16453. noErr                       0  No error
  16454. editionMgrInitErr        -450  Manager not init’ed
  16455. fBsyErr                        Section doing I/O
  16456. notRegisteredSectionErr  -452  Not registered
  16457.  
  16458. æKY IsRegisterSection
  16459. æFc Editions.h
  16460. æT Function
  16461. æTN A82D
  16462. æD pascal OSErr IsRegisterSection(const SectionHandle sectionH)
  16463.     = {0x303C,0x0208,0xA82D}; 
  16464. æDT OSErr myVariable = IsRegisterSection((const SectionHandle) sectionH);
  16465. æC 
  16466. Each time your application receives a section event, your application must use
  16467. the IsRegisteredSection function to verify that the event received is for a
  16468. registered section.
  16469.  
  16470. The sectionH parameter is a handle to the section record for a given section.
  16471. The IsRegisteredSection function does not return a Boolean—noErr indicates that
  16472. a section is registered.
  16473.  
  16474. Result codes
  16475. noErr                       0  No error
  16476. notRegisteredSectionErr  -452  Not registered
  16477.  
  16478. æKY FindEditionContainerDialog
  16479. æFc Editions.h
  16480. æT Function
  16481. æTN A82D
  16482. æD pascal OSErr FindEditionContainerDialog(const CanonicalFileSpec *sectionDocument,
  16483.     SectionHandle sectionH,Boolean *aliasWasChanged)
  16484.     = {0x303C,0x060A,0xA82D}; 
  16485. æDT OSErr myVariable = FindEditionContainerDialog((const CanonicalFileSpec *) sectionDocument,()
  16486.     SectionHandle sectionH,(Boolean *) aliasWasChanged);
  16487. æC 
  16488. If an edition container cannot be found for a particular section during
  16489. registration, use the FindEditionContainerDialog to resolve the alias record of
  16490. the section.
  16491.  
  16492. The sectionDocument parameter is the file name of the document containing a
  16493. section in canonical form. This parameter cannot be NIL. If the
  16494. FindEditionContainerDialog function is successful, the sectionH parameter
  16495. contains the handle to the allocated section record.
  16496.  
  16497. The aliasWasChanged parameter returns TRUE if the alias for the edition
  16498. container that you are subscribing is out of date. This may occur if the file is
  16499. moved to a new location or is renamed.
  16500.  
  16501. The FindEditionContainerDialog functions assumes that your sections are
  16502. contained within the linked list of registered sections.If the
  16503. FindEditionContainerDialog function cannot locate the edition container, it will
  16504. display a dialog box on the user’s screen.
  16505.  
  16506. Result codes
  16507. noErr                    0  No error
  16508. editionMgrInitErr     -450  Manager not init’ed
  16509. containerNotFoundWrn  -461  Alias was not resolved
  16510. multiplePublisherWrn  -460  Already is a publisher
  16511. ???                         SelectAlias errors
  16512.  
  16513. æKY AssociateSection
  16514. æFc Editions.h
  16515. æT Function
  16516. æTN A82D
  16517. æD pascal OSErr AssociateSection(SectionHandle sectionH,const CanonicalFileSpec *newSectionDocument)
  16518.     = {0x303C,0x040C,0xA82D}; 
  16519. æDT OSErr myVariable = AssociateSection((SectionHandle) sectionH,(const CanonicalFileSpec *) newSectionDocument);
  16520. æC 
  16521. If a user renames a document that contains sections or pastes a portion of a
  16522. document that contains a section into another document, use the AssociateSection
  16523. to update the alias record.
  16524.  
  16525. The sectionH parameter is a handle to the section record for a given section.
  16526. The newSectionDocument contains the volume, folder and file name of the new
  16527. document. The AssociateSection function calls the update alias on the alias
  16528. record.
  16529.  
  16530. Result codes
  16531. noErr         0  No error
  16532. ???              UpdateAlias errors
  16533.  
  16534. æKY CreateEditionContainerFile
  16535. æFc Editions.h
  16536. æT Function
  16537. æTN A82D
  16538. æD pascal OSErr CreateEditionContainerFile(const CanonicalFileSpec *editionFile,
  16539.     OSType fdCreator,Short editionFileNameScript)
  16540.     = {0x303C,0x050E,0xA82D}; 
  16541. æDT OSErr myVariable = CreateEditionContainerFile((const CanonicalFileSpec *) editionFile,()
  16542.     OSType fdCreator,(Short) editionFileNameScript);
  16543. æC 
  16544. Each time a user creates a new publisher section within a document to an edition
  16545. that does not already exist, you use the CreateEditionContainerFile to create an
  16546. empty edition container.
  16547.  
  16548. The containerFile parameter contains the volume, folder and file name for the
  16549. edition container being created. The fdCreator parameter contains the creator
  16550. type for the edition.
  16551.  
  16552. The CreateEditionContainerFile function creates an empty edition container file
  16553. (it does not contain any formats). This function creates a file with type
  16554. 'publ'. If your application has a bundle, you should designate an icon for it
  16555. now.
  16556.  
  16557. Result codes
  16558. noErr                   0  No error
  16559. editionMgrInitErr    -450  Manager not init’ed
  16560. ???                        PBHCreate errors
  16561. ???                        PBHOpen errors
  16562. ???                        PBWrite errors
  16563.  
  16564. æKY DeleteEditionContainerFile
  16565. æFc Editions.h
  16566. æT Function
  16567. æTN A82D
  16568. æD pascal OSErr DeleteEditionContainerFile(const CanonicalFileSpec *editionFile)
  16569.     = {0x303C,0x0210,0xA82D}; 
  16570. æDT OSErr myVariable = DeleteEditionContainerFile((const CanonicalFileSpec *) editionFile);
  16571. æC 
  16572. If a user cancels a publisher section within a document or closes a document
  16573. containing a newly created publisher without saving, you need to remove the
  16574. edition container using the DeleteEditionContainerFile function.
  16575.  
  16576. The containerFile parameter contains the volume, folder and file name for the
  16577. edition container being deleted.
  16578.  
  16579. You should use the DeleteEditionContainerFile function even if there are
  16580. subscribers to the edition. When a subscriber section tries to read in data, it
  16581. receives an error.
  16582.  
  16583. Result codes
  16584. noErr                   0  No error
  16585. editionMgrInitErr    -450  Manager not init’ed
  16586. ???                        PBHDelete errors
  16587.  
  16588. æKY OpenEdition
  16589. æFc Editions.h
  16590. æT Function
  16591. æTN A82D
  16592. æD pascal OSErr OpenEdition(SectionHandle subscriberSectionH,EditionRefNum *refNum)
  16593.     = {0x303C,0x0412,0xA82D}; 
  16594. æDT OSErr myVariable = OpenEdition((SectionHandle) subscriberSectionH,(EditionRefNum *) refNum);
  16595. æC 
  16596. You initiate the reading of data from an edition (for a subscriber), use the
  16597. OpenEdition function.
  16598.  
  16599. The subscriberSectionH parameter is a handle to the section record for a given
  16600. section. The refnum parameter returns the reference number for the edition.
  16601.  
  16602. Multiple subscribers can simultaneously read data from a single edition.
  16603.  
  16604. Result codes
  16605. noErr                   0  No error
  16606. editionMgrInitErr    -450  Manager not init’ed
  16607. permErr                    Not a subscriber
  16608.  
  16609. æKY OpenNewEdition
  16610. æFc Editions.h
  16611. æT Function
  16612. æTN A82D
  16613. æD pascal OSErr OpenNewEdition(SectionHandle publisherSectionH,OSType fdCreator,
  16614.     const CanonicalFileSpec *publisherSectionDocument,EditionRefNum *refNum)
  16615.     = {0x303C,0x0814,0xA82D}; 
  16616. æDT OSErr myVariable = OpenNewEdition((SectionHandle) publisherSectionH,(OSType) fdCreator,(
  16617.     const CanonicalFileSpec) * publisherSectionDocument,(EditionRefNum *) refNum);
  16618. æC 
  16619. To initiate the writing of data from a publisher to its edition container, use
  16620. the OpenNewEdition function.
  16621.  
  16622. The publisherSectionH parameter is the publisher section that you are writing to
  16623. the edition. The fdCreator parameter is the Finder creator type of the new
  16624. edition icon.
  16625.  
  16626. The sectionDocument parameter is the document which contains the publisher. This
  16627. parameter is used to create an alias from the edition to the document containing
  16628. the publisher. If you pass NIL for sectionDocument, an alias is not made and the
  16629. GotoPublisherSection function is unable to open the document containing the
  16630. publisher.
  16631.  
  16632. The refnum parameter returns the reference number for the edition. This
  16633. parameter is necessary for subsequent calls to WriteEdition,
  16634. SetEditionFormatMark, and CloseEdition to specify which publisher is writing its
  16635. data to an edition. If the edition cannot be opened for writing because there is
  16636. another publisher writing to it, or because the file system does not allow
  16637. writing, an error is returned and refNum is set to NIL.
  16638.  
  16639. Result codes
  16640. noErr                   0  No error
  16641. editionMgrInitErr    -450  Manager not init’ed
  16642. wrPermErr                  Not a publisher
  16643. notThePublisherWrn   -462  Not the publisher
  16644. ???                        NewHandle errors
  16645. ???                        PBHCreate errors
  16646. ???                        PBHOpen errors
  16647. ???                        NewAlias errors
  16648.  
  16649. æKY CloseEdition
  16650. æFc Editions.h
  16651. æT Function
  16652. æTN A82D
  16653. æD pascal OSErr CloseEdition(EditionRefNum whichEdition,Boolean success)
  16654.     = {0x303C,0x0316,0xA82D}; 
  16655. æDT OSErr myVariable = CloseEdition((EditionRefNum) whichEdition,(Boolean) success);
  16656. æC 
  16657. After finishing reading from or writing to an edition, use the CloseEdition
  16658. function to close the edition.
  16659.  
  16660. The refnum parameter is the reference number for edition. Set the success
  16661. parameter is set to TRUE if the edition successfully closes. If not, set this
  16662. parameter to FALSE.
  16663.  
  16664. When you are finished reading data from an edition and you are using the
  16665. CloseEdition function, the EditionRefNum value becomes invalid. If the success
  16666. parameter is set to TRUE, the CloseEdition function takes the modification date
  16667. of the edition file that you have read in and puts it in the mdDate field of the
  16668. subscriber’s section record. This indicates that the data contained in the
  16669. edition and the subscriber section within the document are the same.
  16670.  
  16671. If you set the success parameter to FALSE because you are unable to read the
  16672. edition data (if there is not enough memory, or you didn’t find a format that
  16673. you can read), the CloseEdition function closes the edition, but does not set
  16674. the modification date field. This implies that the subscriber is not updated
  16675. with the latest edition.
  16676.  
  16677. When you have successfully finished writing data to an edition and you are using
  16678. the CloseEdition function, you should set the success parameter to TRUE. When
  16679. you do so, the data that you have written to the edition becomes available to
  16680. any subscribers. The Edition Manager sends a SectionReadEvent to all current
  16681. subscribers. The CloseEdition function sets the modification date (mdDate) of
  16682. the edition to correspond to the modification date of the publisher’s section
  16683. record. Each time a user edits a publisher within a document, you need to update
  16684. the modification date (even if the data is not yet written). 
  16685.  
  16686. If you set the success parameter to FALSE because you are unable to successfully
  16687. write data to the edition, the Edition Manager does not write any data to the
  16688. edition. The data contained in the edition prior to writing is restored.
  16689. SectionReadEvents are not sent to subscribers.
  16690.  
  16691. Result codes
  16692. noErr                   0  No error
  16693. editionMgrInitErr    -450  Manager not init’ed
  16694. rfNumErr                   Bad refNum
  16695. ???                        PBWrite errors
  16696. ???                        DisposHandle errors
  16697.  
  16698. æKY EditionHasFormat
  16699. æFc Editions.h
  16700. æT Function
  16701. æTN A82D
  16702. æD pascal OSErr EditionHasFormat(EditionRefNum whichEdition,FormatType whichFormat,
  16703.     Size *length)
  16704.     = {0x303C,0x0618,0xA82D}; 
  16705. æDT OSErr myVariable = EditionHasFormat((EditionRefNum) whichEdition,(FormatType) whichFormat,(
  16706.     Size) * length);
  16707. æC 
  16708. Use the EditionHasFormat function to find out in which formats the edition data
  16709. is available.
  16710.  
  16711. The whichEdition parameter is the reference number for the edition. The
  16712. whichFormat parameter indicates the format type that you are requesting. Apple
  16713. Computer recommends that you request formats in order of preference.
  16714.  
  16715. Upon return of the EditionHasFormat function, the length parameter contains the
  16716. length of the format for the edition you are specifying. If the requested format
  16717. is available, this function returns noErr and the length field returns the size
  16718. of the data in the specified format or kFormatLengthUnknown (-1) which signifies
  16719. that the size is unknown. You should continue to read the format until there is
  16720. no more data.
  16721.  
  16722. Be aware that the EditionHasFormat function may return kFormatLengthUnknown for
  16723. the length of the format.
  16724.  
  16725. Result codes
  16726. noErr                   0  No error
  16727. noTypeErr                  Format not available
  16728. editionMgrInitErr    -450  Manager not init’ed
  16729.  
  16730. æKY ReadEdition
  16731. æFc Editions.h
  16732. æT Function
  16733. æTN A82D
  16734. æD pascal OSErr ReadEdition(EditionRefNum whichEdition,FormatType whichFormat,
  16735.     Ptr buffPtr,Size *buffLen)
  16736.     = {0x303C,0x081A,0xA82D}; 
  16737. æDT OSErr myVariable = ReadEdition((EditionRefNum) whichEdition,(FormatType) whichFormat,()
  16738.     Ptr buffPtr,(Size *) buffLen);
  16739. æC 
  16740. Use the ReadEdition function to read data from an edition.
  16741.  
  16742. The whichEdition parameter is the reference number for the edition. The
  16743. whichFormat parameter indicates the format type that you want to read. 
  16744. The buffPtr parameter is a pointer to the buffer into which you are reading the
  16745. edition from. The buffLen parameter is the number of bytes that you want to read
  16746. into the buffer. The buffLen parameter is also a return value that returns the
  16747. total number of bytes read into the buffer. Once the buffLen field returns a
  16748. value less than the value you have specified, there is no additional data to
  16749. read, and the ReadEdition function returns noErr. If use the ReadEdition
  16750. function after all data is read in, the ReadEdition function returns an EoFErr.
  16751.  
  16752. Result codes
  16753. noErr                   0  No error
  16754. editionMgrInitErr    -450  Manager not init’ed
  16755. noTypeErr                  Format not available
  16756. rfNumErr                   Bad refNum
  16757. EofErr
  16758.  
  16759. æKY WriteEdition
  16760. æFc Editions.h
  16761. æT Function
  16762. æTN A82D
  16763. æD pascal OSErr WriteEdition(EditionRefNum whichEdition,FormatType whichFormat,
  16764.     Ptr buffPtr,Size buffLen)
  16765.     = {0x303C,0x081C,0xA82D}; 
  16766. æDT OSErr myVariable = WriteEdition((EditionRefNum) whichEdition,(FormatType) whichFormat,()
  16767.     Ptr buffPtr,(Size) buffLen);
  16768. æC 
  16769. Use the WriteEdition function to write data to an edition.
  16770.  
  16771. The refnum parameter is the reference number for edition. The whichFormat
  16772. parameter indicates the format type that you want to write. 
  16773.  
  16774. The buffPtr parameter is a pointer to the buffer that you are writing into the
  16775. edition. The buffLen parameter is the number of bytes that you are writing. If
  16776. data cannot be entirely written to the edition, the WriteEdition function
  16777. returns a error.
  16778.  
  16779. Result codes
  16780. noErr                   0  No error
  16781. editionMgrInitErr    -450  Manager not init’ed
  16782. noTypeErr                  Unknown format
  16783. rfNumErr                   Bad refNum
  16784.  
  16785. æKY GetEditionFormatMark
  16786. æFc Editions.h
  16787. æT Function
  16788. æTN A82D
  16789. æD pascal OSErr GetEditionFormatMark(EditionRefNum whichEdition,FormatType whichFormat,
  16790.     long *currentMark)
  16791.     = {0x303C,0x061E,0xA82D}; 
  16792. æDT OSErr myVariable = GetEditionFormatMark((EditionRefNum) whichEdition,(FormatType) whichFormat,(
  16793.     long) * currentMark);
  16794. æC 
  16795. Use the GetEditionFormatMark to locate the current marker for a particular
  16796. format.
  16797.  
  16798. The whichEdition parameter is the reference number for the edition. The
  16799. whichFormat parameter indicates the format type for the edition and the
  16800. currentMark parameter is the offset for the format. 
  16801.  
  16802. If you do not support the format that you are specifying, you receive noTypeErr.
  16803.  
  16804. Result codes
  16805. noErr         0  No error
  16806. noTypeErr        Unknown format
  16807. posErr           Mark not set anywhere
  16808.  
  16809. æKY SetEditionFormatMark
  16810. æFc Editions.h
  16811. æT Function
  16812. æTN A82D
  16813. æD pascal OSErr SetEditionFormatMark(EditionRefNum whichEdition,FormatType whichFormat,
  16814.     long setMarkTo)
  16815.     = {0x303C,0x0620,0xA82D}; 
  16816. æDT OSErr myVariable = SetEditionFormatMark((EditionRefNum) whichEdition,(FormatType) whichFormat,()
  16817.     long setMarkTo);
  16818. æC 
  16819. Use the SetEditionFormatMark to set the current mark for a section format.
  16820.  
  16821. The whichEdition parameter is the reference number for the edition. The
  16822. whichFormat parameter indicates the format type for the edition and the
  16823. setMarkTo parameter is the offset for the format.
  16824.  
  16825. When you are creating a publisher, and if the whichFormat does not exist for a
  16826. particular edition that you are writing data to, the SetEditionFormatMark
  16827. creates the format. You need to call the SetEditionFormatMark function before
  16828. writing data.
  16829.  
  16830. Result codes
  16831. noErr         0  No error
  16832. posErr           Manager not init’ed
  16833. ???              SetHandleSize errors
  16834.  
  16835. æKY GetEditionInfo
  16836. æFc Editions.h
  16837. æT Function
  16838. æTN A82D
  16839. æD pascal OSErr GetEditionInfo(const SectionHandle sectionH,EditionInfoRecord *editionInfo)
  16840.     = {0x303C,0x0422,0xA82D}; 
  16841. æDT OSErr myVariable = GetEditionInfo((const SectionHandle) sectionH,(EditionInfoRecord *) editionInfo);
  16842. æC 
  16843. When the user wants to locate the publisher for a particular subscriber (by
  16844. choosing Find Publisher in the subscriber options dialog box), use the
  16845. GetEditionInfo function to find the edition container. You should then call the
  16846. GotoPublisherSection function.
  16847.  
  16848. The GetEditionInfo function returns information about a section’s edition such
  16849. as it’s location, last modification date, creator and type. This function only
  16850. works for registered sections which contain a non-NIL control block.
  16851.  
  16852. The sectionH parameter is a handle to the section record for a given section.
  16853. The editionInfo parameter is a pointer from the EditionInfo record. The
  16854. GetEditionInfo function comprises the public information contained in the
  16855. control block.
  16856.  
  16857. The Edition Manager syncs to ensure that the existing edition name corresponds
  16858. to the Finder’s existing edition name. Refer to “Reading and Writing Edition
  16859. Data” for additional information. If an edition container could not be located
  16860. previously, the GetEditionInfo function tries to locate it again. If it cannot
  16861. be located a second time, the GetEditionInfo function returns a file not found
  16862. err.
  16863.  
  16864. TYPE EditionInfoRecord = 
  16865. RECORD
  16866.   crDate:     TimeStamp;
  16867.   mdDate:     TimeStamp;
  16868.   fdCreator:  OSType;
  16869.   fdType:     OSType;
  16870.   container:  EditionContainerSpec;
  16871. END;
  16872.  
  16873. The fdType field is the creator type 'publ'. The fdCreator field is specified in
  16874. the OpenNewEdition function. The container field is a volume, folder, and file
  16875. name for the edition.
  16876.  
  16877. The crDate field contains the creation date of the edition. The mdDate field
  16878. contains the modification date of the edition.
  16879.  
  16880. Result codes
  16881. noErr                   0  No error
  16882. editionMgrInitErr    -450  Manager not init’ed
  16883. fnfErr                     Not registered or file moved
  16884. ???                        PBHGetFInfo
  16885.  
  16886. æKY GotoPublisherSection
  16887. æFc Editions.h
  16888. æT Function
  16889. æTN A82D
  16890. æD pascal OSErr GotoPublisherSection(const EditionContainerSpec *container)
  16891.     = {0x303C,0x0224,0xA82D}; 
  16892. æDT OSErr myVariable = GotoPublisherSection((const EditionContainerSpec *) container);
  16893. æC 
  16894. Use the GotoPublisherSection function to resolve the alias in the edition to
  16895. find the document containing its publisher. This function opens the document,
  16896. launches it’s application if necessary, and scrolls to the location of the
  16897. publisher. 
  16898.  
  16899. The container parameter is the edition volume, folder, and file name. You obtain
  16900. the container by calling the GetEditionInfo function.
  16901.  
  16902. You should call the GotoPublisherSection function when the user selects Find
  16903. Publisher within the publisher options dialog box. The action code 'goto' is
  16904. returned to you.
  16905.  
  16906. Result codes
  16907. noErr                   0  No error
  16908. editionMgrInitErr    -450  Manager not init’ed
  16909. badSubPartErr        -454  Invalid container
  16910. MemError                   NewHandle errors
  16911. ???                        ResolveAlias errors
  16912.  
  16913. æKY GetLastEditionContainerUsed
  16914. æFc Editions.h
  16915. æT Function
  16916. æTN A82D
  16917. æD pascal OSErr GetLastEditionContainerUsed(const EditionContainerSpec *container)
  16918.     = {0x303C,0x0226,0xA82D}; 
  16919. æDT OSErr myVariable = GetLastEditionContainerUsed((const EditionContainerSpec *) container);
  16920. æC 
  16921. The Edition Manager supports three dialog boxes: new publisher and new
  16922. subscriber dialog boxes and an options dialog box. Your application can display
  16923. “simple” dialog boxes which require reply records, or you can customize your
  16924. dialog boxes.
  16925.  
  16926. Use the GetLastEditionContainerUsed function to display the last edition within
  16927. the dialog boxes. This function enables a user to easily subscribe to the data
  16928. recently published.
  16929.  
  16930. If the GetLastEditionContainer function locates the last edition for which a
  16931. section was created, the container parameter contains its volume, folder, file
  16932. name, part, and returns noErr. (The last edition created is associated with the
  16933. last time that you used the NewSection function.) If the last edition created to
  16934. is moved or deleted, the GetLastEditionContainer function cannot locate the last
  16935. edition. The container parameter returns the volume and folder for the edition,
  16936. leaves the file name blank, and returns fnfErr.
  16937.  
  16938. The Edition Manager syncs to ensure that its existing edition name corresponds
  16939. to the Finder’s existing edition name. Refer to “Reading and Writing Edition
  16940. Data” for additional information.
  16941.  
  16942. Pass the information from the GetLastEditionContainerUsed function to the
  16943. NewSubscriberDialog and the NewPublisherDialog functions.
  16944.  
  16945. Result codes
  16946. noErr                   0  No error
  16947. editionMgrInitErr    -450  Manager not init’ed
  16948. fnfErr                     Container not found
  16949.  
  16950. æKY GetStandardFormats
  16951. æFc Editions.h
  16952. æT Function
  16953. æTN A82D
  16954. æD pascal OSErr GetStandardFormats(const EditionContainerSpec *container,FormatType *previewFormat,
  16955.     Handle preview,Handle publisherAliss,Handle formats)
  16956.     = {0x303C,0x0A28,0xA82D}; 
  16957. æDT OSErr myVariable = GetStandardFormats((const EditionContainerSpec *) container,(FormatType *) previewFormat,()
  16958.     Handle preview,(Handle) publisherAliss,(Handle) formats);
  16959. æC 
  16960. This function is called by the Edition Manager to get the alias used in the
  16961. GotoPublisherSection function and to get the preview shown in the new subscriber
  16962. dialog box. You will probably not need to call this function directly.
  16963.  
  16964. The container parameter is a pointer to the edition volume, folder, file name
  16965. and part.
  16966.  
  16967. You should pass in valid handes for the formats that you want and NIL for the
  16968. formats that you don’t want. The handles are resized to the size of the data.
  16969. The handle fmts reads the virtual format kFormatListFormat, the handle alis
  16970. reads the format kPublisherDocAliasFormat and the handle prvw tries to find the
  16971. following formats in this order: prvw, PICT and then TEXT. The first format
  16972. located returns in the preview handle and the previewFormat parameter is set to
  16973. its type. If none of the requested formats can be found, noTypeErr is returned.
  16974.  
  16975. Result codes
  16976. noErr                   0  No error
  16977. editionMgrInitErr    -450  Manager not init’ed
  16978. noTypeErr                  Container not found
  16979. MemError                   SetHandleSize errors
  16980. ???                        ResolveAlias errors
  16981.  
  16982. æKY GetEditionOpenerProc
  16983. æFc Editions.h
  16984. æT Function
  16985. æTN A82D
  16986. æD pascal OSErr GetEditionOpenerProc(EditionOpenerProcPtr *opener)
  16987.     = {0x303C,0x022A,0xA82D}; 
  16988. æDT OSErr myVariable = GetEditionOpenerProc((EditionOpenerProcPtr *) opener);
  16989. æC 
  16990. Use the GetEditionOpenerProc to locate the current edition opener procedure.
  16991.  
  16992. The opener procedure returns the pointer to the current edition opener
  16993. procedure.
  16994.  
  16995. The PB parameter of the CallFormatIOProc function is a FormatIOParamBlock
  16996. record.
  16997.  
  16998. TYPE FormatIOParamBlock = 
  16999. RECORD
  17000.   ioRefNum:     LongInt;     {}
  17001.   format:       FormatType;  {}
  17002.   formatIndex:  LongInt;     {}
  17003.   offset:       LongInt;     {}
  17004.   buffPtr:      Ptr;         {}
  17005.   buffLen:      LongInt;     {}
  17006. END;
  17007.  
  17008. The routine parameter is a pointer to a format I/O procedure.
  17009.  
  17010. You should have an IO function that contains the following parameters.
  17011.  
  17012. FUNCTION IO (selector: FormatIOVerb; VAR PB: FormatIOParamBlock) : OSErr;
  17013.  
  17014. æKY SetEditionOpenerProc
  17015. æFc Editions.h
  17016. æT Function
  17017. æTN A82D
  17018. æD pascal OSErr SetEditionOpenerProc(EditionOpenerProcPtr opener)
  17019.     = {0x303C,0x022C,0xA82D}; 
  17020. æDT OSErr myVariable = SetEditionOpenerProc((EditionOpenerProcPtr) opener);
  17021. æC 
  17022. Use the SetEditionOpenProc to provide your own edition opener procedure.
  17023.  
  17024. The opener parameter is a pointer to the edition opener procedure that you are
  17025. providing.
  17026.  
  17027.  
  17028. æKY CallEditionOpenerProc
  17029. æFc Editions.h
  17030. æT Function
  17031. æTN A82D
  17032. æD pascal OSErr CallEditionOpenerProc(EditionOpenerVerb selector,EditionOpenerParamBlock *PB,
  17033.     EditionOpenerProcPtr routine)
  17034.     = {0x303C,0x052E,0xA82D}; 
  17035. æDT OSErr myVariable = CallEditionOpenerProc((EditionOpenerVerb) selector,(EditionOpenerParamBlock *) PB,()
  17036.     EditionOpenerProcPtr routine);
  17037. æC 
  17038. The Edition Manager never opens or closes an edition container directly—it calls
  17039. the current “EditionOpener.” Use the CallEditionOpenerProc to call the edition
  17040. opener procedure pointer.
  17041.  
  17042. Set the selector parameter to one of the edition opener verbs (eoOpen, eoClose,
  17043. eoOpenNew, eoCloseNew, eoCanSubscribe). The params parameter is an
  17044. EditionOpenerParamBlock record.
  17045.  
  17046. TYPE EditionOpenerParamBlock = 
  17047. RECORD
  17048.   info:      EditionInfoRecord;      {}
  17049.   sectionH:  SectionHandle;          {}
  17050.   document:  CanonicalFileSpecPtr;   {}
  17051.   misc:      LongInt;                {}
  17052.   ioRefNum:  LongInt;                {}
  17053.   ioProc:    FormatIOProcPtr;        {}
  17054. END;
  17055.  
  17056. The routine parameter is a pointer to an edition opener procedure.
  17057.  
  17058. æKY CallFormatIOProc
  17059. æFc Editions.h
  17060. æT Function
  17061. æTN A82D
  17062. æD pascal OSErr CallFormatIOProc(FormatIOVerb selector,FormatIOParamBlock *PB,
  17063.     FormatIOProcPtr routine)
  17064.     = {0x303C,0x0530,0xA82D}; 
  17065. æDT OSErr myVariable = CallFormatIOProc((FormatIOVerb) selector,(FormatIOParamBlock *) PB,()
  17066.     FormatIOProcPtr routine);
  17067. æC 
  17068.  
  17069. æKY NewSubscriberDialog
  17070. æFc Editions.h
  17071. æT Function
  17072. æTN A82D
  17073. æD pascal OSErr NewSubscriberDialog(NewSubscriberReply *reply)
  17074.     = {0x303C,0x0232,0xA82D}; 
  17075. æDT OSErr myVariable = NewSubscriberDialog((NewSubscriberReply *) reply);
  17076. æC 
  17077. Use the NewSubscriberDialog function to display the new subscriber dialog box on
  17078. the user’s screen.
  17079.  
  17080. FUNCTION NewSubscriberDialog (VAR reply: NewSubscriberReply) : OSErr;
  17081.  
  17082. The reply parameter is the NewSubscriberReply record.
  17083.  
  17084. TYPE NewSubscriberReply = 
  17085. RECORD
  17086.   canceled:   Boolean;               {out}
  17087.   container:  EditionContainerSpec;  {in/out}
  17088. END;
  17089.  
  17090. Set the container parameter to be a pointer to a volume, folder, file name, and
  17091. part for the last edition subscribed to.
  17092.  
  17093. Upon return of the NewSubscriberDialog function, if the canceled parameter is
  17094. set to TRUE, the user canceled the dialog box. Otherwise, this parameter is
  17095. FALSE and the container parameter holds the container for the new subscriber.
  17096.  
  17097. Result codes
  17098. noErr                   0  No error
  17099. editionMgrInitErr    -450  Package not init’ed
  17100. badSubPartErr        -454  Bad container spec
  17101. MemError                   NewHandle errors
  17102. ResError                   GetResource errors
  17103.  
  17104. æKY NewSubscriberExpDialog
  17105. æFc Editions.h
  17106. æT Function
  17107. æTN A82D
  17108. æD pascal OSErr NewSubscriberExpDialog(NewSubscriberReply *reply,Point where,
  17109.     Short expansionDITLresID,ExpDlgHookProcPtr dlgHook,ExpModalFilterProcPtr filterProc,
  17110.     Ptr yourDataPtr)
  17111.     = {0x303C,0x0B34,0xA82D}; 
  17112. æDT OSErr myVariable = NewSubscriberExpDialog((NewSubscriberReply *) reply,(Point) where,()
  17113.     Short expansionDITLresID,(ExpDlgHookProcPtr) dlgHook,(ExpModalFilterProcPtr) filterProc,()
  17114.     Ptr yourDataPtr);
  17115. æC 
  17116. Use the NewSubscriberExpDialog function to customize the new subscriber dialog
  17117. box.
  17118.  
  17119. The NewSubscriberExpDialog, NewPublisherExpDialog, and SectionOptionsExpDialog
  17120. functions share the same parameters. Refer below for a detailed explanation of
  17121. the parameters.
  17122.  
  17123. Result codes
  17124. noErr                   0  No error
  17125. editionMgrInitErr    -450  Package not init’ed
  17126. MemError                   NewHandle errors
  17127. ResError                   GetResource errors
  17128.  
  17129. æKY NewPublisherDialog
  17130. æFc Editions.h
  17131. æT Function
  17132. æTN A82D
  17133. æD pascal OSErr NewPublisherDialog(NewSubscriberReply *reply)
  17134.     = {0x303C,0x0236,0xA82D}; 
  17135. æDT OSErr myVariable = NewPublisherDialog((NewSubscriberReply *) reply);
  17136. æC 
  17137. Use the NewPublisherDialog function to display the new publisher dialog box on
  17138. the user’s screen.
  17139.  
  17140. The reply parameter is a pointer from the NewPublisherReply record.
  17141.  
  17142. TYPE NewPublisherReply = 
  17143. RECORD
  17144.   canceled:       Boolean;              {out}
  17145.   replacing:      Boolean;              {out}
  17146.   usePart:        Boolean;              {in}
  17147.   preview:        Handle;               {in}
  17148.   previewFormat:  FormatType;           {in}
  17149.   container:      EditionContainerSpec  {in/out}
  17150. END;
  17151.  
  17152. The usePart parameter must be set to FALSE before calling the NewPublisherDialog
  17153. routine.
  17154.  
  17155. Set the container parameter to be a pointer to a volume, folder, and file name
  17156. for a default edition. Set the preview parameter to be a handle to the format
  17157. for the default edition and set the previewFormat parameter to indicate the
  17158. format of the default edition.
  17159.  
  17160. Upon return of the NewPublisherDialog function, the following three output
  17161. parameters can be set. If the canceled parameter is set to TRUE, the user
  17162. canceled the dialog box. If the replacing parameter is TRUE, the user chose an
  17163. existing file name from the list of available editions and confirmed this
  17164. replacement. If the replacing parameter is TRUE, do not call the
  17165. CreateEditionContainerFile function which creates a new edition container. The
  17166. container parameter contains the volume, folder and file name for the default
  17167. edition. 
  17168. Deallocate the preview parameter to free up memory.
  17169.  
  17170. Result codes
  17171. noErr                   0  No error
  17172. editionMgrInitErr    -450  Package not init’ed
  17173. badSubPartErr        -454  Bad container spec
  17174. MemError                   NewHandle errors
  17175. ResError                   GetResource errors
  17176.  
  17177. æKY NewPublisherExpDialog
  17178. æFc Editions.h
  17179. æT Function
  17180. æTN A82D
  17181. æD pascal OSErr NewPublisherExpDialog(NewSubscriberReply *reply,Point where,
  17182.     Short expansionDITLresID,ExpDlgHookProcPtr dlgHook,ExpModalFilterProcPtr filterProc,
  17183.     Ptr yourDataPtr)
  17184.     = {0x303C,0x0B38,0xA82D}; 
  17185. æDT OSErr myVariable = NewPublisherExpDialog((NewSubscriberReply *) reply,(Point) where,()
  17186.     Short expansionDITLresID,(ExpDlgHookProcPtr) dlgHook,(ExpModalFilterProcPtr) filterProc,()
  17187.     Ptr yourDataPtr);
  17188. æC 
  17189. Use the NewPublisherExpDialog function to customize the new publisher dialog
  17190. box.
  17191.  
  17192. The NewSubscriberExpDialog, NewPublisherExpDialog, and SectionOptionsExpDialog
  17193. functions share the same parameters. Refer below for a detailed explanation of
  17194. the parameters.
  17195.  
  17196. Result codes
  17197. noErr                   0  No error
  17198. editionMgrInitErr    -450  Package not init’ed
  17199. MemError                   NewHandle errors
  17200. ResError                   GetResource errors
  17201.  
  17202. æKY SectionOptionsDialog
  17203. æFc Editions.h
  17204. æT Function
  17205. æTN A82D
  17206. æD pascal OSErr SectionOptionsDialog(SectionOptionsReply *reply)
  17207.     = {0x303C,0x023A,0xA82D}; 
  17208. æDT OSErr myVariable = SectionOptionsDialog((SectionOptionsReply *) reply);
  17209. æC 
  17210. Use the SectionOptionsDialog function to display the publisher options and
  17211. subscriber options dialog boxes on the user’s screen.
  17212.  
  17213. The reply parameter is a pointer from the SectionOptionsReply record.
  17214.  
  17215. TYPE SectionOptionsReply = 
  17216. RECORD
  17217.   canceled:  Boolean;       {out}
  17218.   changed:   Boolean;       {out}
  17219.   sectionH:  SectionHandle; {in}
  17220.   action:    ResType;       {out}
  17221. END;
  17222.  
  17223. The sectionH parameter is a handle to the section record for a given section.
  17224.  
  17225. Upon return of the SectionOptionsDialog function, the following output
  17226. parameters can be set. If the canceled parameter is set to TRUE, the user
  17227. canceled the dialog box. Otherwise, this parameter is FALSE. If the changed
  17228. parameter is TRUE (if for example, the update mode is changed), the user changed
  17229. the section record.
  17230.  
  17231. The action parameter contains the code for 1 of 4 user actions. 
  17232.  
  17233.   •   action code is 'read' for user selection of Get Edition Now
  17234.   •   action code is 'writ' for user selection of Publish Now
  17235.   •   action code is 'goto' for user selection of Find Publisher
  17236.   •   action code is 'cncl' for user selection of Cancel Publisher or Cancel 
  17237.       Subscriber
  17238.  
  17239. Your application can expand dialog boxes to include DITL items, apply alternate
  17240. mapping of events to item hits, and apply alternate meanings to the item hits.
  17241.  
  17242. æKY SectionOptionsExpDialog
  17243. æFc Editions.h
  17244. æT Function
  17245. æTN A82D
  17246. æD pascal OSErr SectionOptionsExpDialog(SectionOptionsReply *reply,Point where,
  17247.     Short expansionDITLresID,ExpDlgHookProcPtr dlgHook,ExpModalFilterProcPtr filterProc,
  17248.     Ptr yourDataPtr)
  17249.     = {0x303C,0x0B3C,0xA82D}; 
  17250. æDT OSErr myVariable = SectionOptionsExpDialog((SectionOptionsReply *) reply,(Point) where,()
  17251.     Short expansionDITLresID,(ExpDlgHookProcPtr) dlgHook,(ExpModalFilterProcPtr) filterProc,()
  17252.     Ptr yourDataPtr);
  17253. æC 
  17254. Use the SectionOptionsExpDialog function to customize the publisher and
  17255. subscriber dialog boxes.
  17256.  
  17257. The NewSubscriberExpDialog, NewPublisherExpDialog, and SectionOptionsExpDialog
  17258. functions share the same parameters. Refer below for a detailed explanation of
  17259. the parameters.
  17260.  
  17261. Result codes
  17262. noErr                   0  No error
  17263. editionMgrInitErr    -450  Package not init’ed
  17264. MemError                   NewHandle errors
  17265. ResError                   GetResource errors
  17266.  
  17267. The reply parameter is a pointer from the NewSubscriberReply, NewPublisherReply,
  17268. or the SectionOptionsReply records.
  17269.  
  17270. You can automatically center the dialog box by passing <-1, -1> in the where
  17271. field. The expansionDITLresID field should be zero or a valid dialog item list 
  17272. (DITL) resource ID. This integer is the ID of a DITL whose items are appended to
  17273. the end of the standard dialog DITL. The DITL items keep their relative
  17274. positions, but when they are moved, they move as a group to the bottom of the
  17275. dialog box. For international purposes, the location of the DITL items is not
  17276. always the bottom of the dialog box. The location can be specified by a user
  17277. item in the main DITL. For different script systems, you should arrange your
  17278. expansionDITL items appropriately. Refer to the Dialog Manager chapter for
  17279. additional information on DITL.
  17280.  
  17281. The filterProc parameter should be a valid ExpModalFilterProcPtr or NIL. This
  17282. procedure is called by the dialog box filterProc. This function enables you to
  17283. map real events (mouse-down or up or key-down or up) to a hit on an item (such
  17284. as a cancel button). Each item corresponds to a number. You may want to map a
  17285. command-key equivalent to an item hit .
  17286.  
  17287. The dlgHook parameter should be a valid ExpDlgHookProcPtr or NIL. This procedure
  17288. is called with each call to a dialog box. The dlgHook parameter makes the
  17289. appropriate action such as filling in a check box with an ‘X’ if this particular
  17290. item is selected by the user. The itemOffset passed to the procedure is the
  17291. number of items in the dialog item list befoe the expansionDITL items. You need
  17292. to subtract itemOffset from item to get the relative item number in the
  17293. expanstionDITL. The return value from dlgHook is the absolute item number. Some
  17294. special values for item are: kFirstHookCall (-1), kNullHookCall (100), and
  17295. kRebuildFileList (101).
  17296.  
  17297. The callBackPtr parameter is reserved for your use.
  17298.  
  17299.  
  17300. æKY EPPC.h
  17301. æKL AcceptHighLevelEvent
  17302. GetPortNameFromProcessSerialNumber
  17303. GetProcessSerialNumberFromPortName
  17304. GetSpecificHighLevelEvent
  17305. PostHighLevelEvent
  17306.  
  17307. bufferIsSmall
  17308. connectionInValid
  17309. GetSpecificFilterProcPtr
  17310. HighLevelEventMsg
  17311. HighLevelEventMsgClass
  17312. HighLevelEventMsgHdl
  17313. HighLevelEventMsgPtr
  17314. kHighLevelEvent
  17315. msgWasFullyAccepted
  17316. msgWasNotAccepted
  17317. msgWasPartiallyAccepted
  17318. nAttnMsg
  17319. noOutstandingHLE
  17320. nReturnReceipt
  17321. priorityMask
  17322. receiverIDisPSN
  17323. receiverIDisSessionID
  17324. receiverIDisSignature
  17325. receiverIDisTargetID
  17326. receiverIDMask
  17327. registerOnNetwork
  17328. rtrnReciptMsgID
  17329. systemOptionsMask
  17330. TargetID
  17331. TargetIDPtr
  17332.  
  17333. æKY kHighLevelEvent
  17334. æFc EPPC.h
  17335. æT #define
  17336. æD #define kHighLevelEvent 23
  17337. æC 
  17338.  
  17339. æKY receiverIDMask
  17340. æFc EPPC.h
  17341. æT #define
  17342. æD 
  17343. /*  postOptions currently supported */
  17344.  
  17345. #define receiverIDMask 0x0000F000
  17346. æC 
  17347.  
  17348. æKY receiverIDisPSN
  17349. æFc EPPC.h
  17350. æT #define
  17351. æD #define receiverIDisPSN 0x00008000
  17352. æC 
  17353.  
  17354. æKY receiverIDisSignature
  17355. æFc EPPC.h
  17356. æT #define
  17357. æD #define receiverIDisSignature 0x00007000
  17358. æC 
  17359.  
  17360. æKY receiverIDisSessionID
  17361. æFc EPPC.h
  17362. æT #define
  17363. æD #define receiverIDisSessionID 0x00006000
  17364. æC 
  17365.  
  17366. æKY receiverIDisTargetID
  17367. æFc EPPC.h
  17368. æT #define
  17369. æD #define receiverIDisTargetID 0x00005000
  17370. æC 
  17371.  
  17372. æKY systemOptionsMask
  17373. æFc EPPC.h
  17374. æT #define
  17375. æD #define systemOptionsMask 0x00000F00
  17376. æC 
  17377.  
  17378. æKY nReturnReceipt
  17379. æFc EPPC.h
  17380. æT #define
  17381. æD #define nReturnReceipt 0x00000200
  17382. æC 
  17383.  
  17384. æKY priorityMask
  17385. æFc EPPC.h
  17386. æT #define
  17387. æD #define priorityMask 0x000000FF
  17388. æC 
  17389.  
  17390. æKY nAttnMsg
  17391. æFc EPPC.h
  17392. æT #define
  17393. æD #define nAttnMsg 0x00000001
  17394. æC 
  17395.  
  17396. æKY registerOnNetwork
  17397. æFc EPPC.h
  17398. æT #define
  17399. æD #define registerOnNetwork 0x80000000
  17400. æC 
  17401.  
  17402. æKY bufferIsSmall
  17403. æFc EPPC.h
  17404. æT #define
  17405. æD 
  17406. /*  error returns from Post and Accept */
  17407.  */
  17408.  
  17409. #define bufferIsSmall -607
  17410. æC 
  17411.  
  17412. æKY noOutstandingHLE
  17413. æFc EPPC.h
  17414. æT #define
  17415. æD #define noOutstandingHLE -608
  17416. æC 
  17417.  
  17418. æKY connectionInValid
  17419. æFc EPPC.h
  17420. æT #define
  17421. æD #define connectionInValid -609
  17422. æC 
  17423.  
  17424. æKY HighLevelEventMsgClass
  17425. æFc EPPC.h
  17426. æT #define
  17427. æD 
  17428. /*  constant for return receipts */
  17429.  */
  17430.  
  17431. #define HighLevelEventMsgClass 'jaym'
  17432. æC 
  17433.  
  17434. æKY rtrnReciptMsgID
  17435. æFc EPPC.h
  17436. æT #define
  17437. æD #define rtrnReciptMsgID 'rtrn'
  17438. æC 
  17439.  
  17440. æKY msgWasPartiallyAccepted
  17441. æFc EPPC.h
  17442. æT #define
  17443. æD #define msgWasPartiallyAccepted 2
  17444. æC 
  17445.  
  17446. æKY msgWasFullyAccepted
  17447. æFc EPPC.h
  17448. æT #define
  17449. æD #define msgWasFullyAccepted 1
  17450. æC 
  17451.  
  17452. æKY msgWasNotAccepted
  17453. æFc EPPC.h
  17454. æT #define
  17455. æD #define msgWasNotAccepted 0
  17456. æC 
  17457.  
  17458. æKY GetSpecificFilterProcPtr
  17459. æFc EPPC.h
  17460. æT typedef
  17461. æD typedef pascal Boolean (*GetSpecificFilterProcPtr) (unsigned long *param, HighLevelEventMsgPtr msgBuff, TargetID *sender);
  17462. æC 
  17463.  
  17464. æKY TargetID
  17465. TargetIDPtr
  17466. æFc EPPC.h
  17467. æT struct
  17468. æD struct TargetID {
  17469.     long sessionID;
  17470.     PortName name;
  17471.     LocName location;
  17472.     PortName recvrName;
  17473. };
  17474.  
  17475. typedef struct TargetID TargetID;
  17476. typedef TargetID *TargetIDPtr;
  17477.  
  17478. typedef struct TargetID SenderID, *SenderIDPtr;
  17479.  
  17480.  
  17481. æC 
  17482.  
  17483. æKY HighLevelEventMsg
  17484. HighLevelEventMsgPtr
  17485. HighLevelEventMsgHdl
  17486. æFc EPPC.h
  17487. æT struct
  17488. æD struct HighLevelEventMsg {
  17489.     long sessionID;
  17490.     unsigned short HighLevelEventMsgHeaderLength;
  17491.     unsigned short version;
  17492.     unsigned long reserved1;
  17493.     EventRecord theMsgEvent;
  17494.     unsigned long userRefcon;
  17495.     unsigned long postingOptions;
  17496.     unsigned long msgLength;
  17497. };
  17498.  
  17499. typedef struct HighLevelEventMsg HighLevelEventMsg;
  17500. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHdl;
  17501.  
  17502. æC 
  17503.  
  17504. æKY PostHighLevelEvent
  17505. æFc EPPC.h
  17506. æT Function
  17507. æTN A88F
  17508. æD 
  17509. pascal OSErr PostHighLevelEvent(EventRecord *theEvent,unsigned long receiverID,
  17510.     unsigned long msgRefcon,Ptr msgBuff,unsigned long msgLen,unsigned long postingOptions)
  17511.     = {0x3F3C,0x0034,0xA88F}; 
  17512. æDT OSErr myVariable = PostHighLevelEvent((EventRecord *) theEvent,(unsigned long) receiverID,(
  17513.     unsigned) long msgRefcon,(Ptr) msgBuff,(unsigned long) msgLen,(unsigned long) postingOptions);
  17514. æC 
  17515. You can use the PostHighLevelEvent routine to send a high-level event to another
  17516. application.
  17517.  
  17518. You specify the event to send in parameter theEvent, and include any additional
  17519. data for the event by providing a pointer to a data buffer in the msgBuff
  17520. parameter. The msgLen parameter specifies the size of the data buffer. The
  17521. receiverID parameter specifies the recipient of the event. The msgRefcon
  17522. parameter specifies a unique number associated with this event. Your application
  17523. can set this field to any value it chooses.
  17524.  
  17525. You can specify the receiver of the event by session ID, process serial number,
  17526. signature, or port name and port location. You can use any of these
  17527. specifications to send an event to another application on the local machine. You
  17528. can use only the session ID or port name and port location to send an event to
  17529. an application on a remote machine.
  17530.  
  17531. You use the postingOptions parameter to specify delivery options and options
  17532. associated with the receiverID parameter. You can specify one or more delivery
  17533. options to indicate whether you want the other application to receive the event
  17534. at the next opportunity, and to indicate whether you want acknowledgment that
  17535. the event was received by the other application. You use the options associated
  17536. with the receiverID parameter to indicate how you are specifying the recipient
  17537. of the event.
  17538.  
  17539. Result codes
  17540. noErr                 0  Mo error
  17541. connectionInValid  –609  Connection is invalid
  17542.  
  17543. æKY AcceptHighLevelEvent
  17544. æFc EPPC.h
  17545. æT Function
  17546. æTN A88F
  17547. æD 
  17548. pascal OSErr AcceptHighLevelEvent(TargetID *sender,unsigned long *msgRefcon,
  17549.     Ptr msgBuff,unsigned long *msgLen)
  17550.     = {0x3F3C,0x0033,0xA88F}; 
  17551. æDT OSErr myVariable = AcceptHighLevelEvent((TargetID *) sender,(unsigned long *) msgRefcon,()
  17552.     Ptr msgBuff,(unsigned long *) msgLen);
  17553. æC 
  17554. Some high-level events may be fully specified by their event record only, while
  17555. others may include additional information in an optional buffer. To get any
  17556. additional information and to find the sender of the event, use the
  17557. AcceptHighLevelEvent function.
  17558.  
  17559. The sender of the event is specified in the sender parameter, which is a pointer
  17560. to a TargetID data structure. The sender parameter contains the session
  17561. reference number that identifes this communication and the port name and port
  17562. location of the sender.
  17563.  
  17564. The msgRefcon parameter is a unique number that is used to identify this event.
  17565. If you send a response to this event, you should specify the same value of
  17566. msgRefcon so that the sender of the event can associate the reply with the
  17567. original request.
  17568.  
  17569. The msgBuff parameter points to any additional data associated with the event.
  17570. The msgLen parameter contains the size of the buffer. Your application is
  17571. responsible for allocating the memory for the additional data pointed to by the
  17572. msgBuff parameter. If the msgBuff parameter points to an area in memory that is
  17573. not large enough to hold all the data associated with the event,
  17574. AcceptHighLevelEvent returns the result code bufferIsSmall. If
  17575. AcceptHighLevelEvent returns the result code bufferIsSmall, the msgLen parameter
  17576. contains the number of bytes remaining. You can call AcceptHighLevelEvent again
  17577. to receive the rest of the data.
  17578.  
  17579. Result codes
  17580. noErr                0  No error
  17581. bufferIsSmall     –607  Buffer is too small
  17582. noOutstandingHLE  –608  No outstanding high-level event
  17583.  
  17584. æKY GetProcessSerialNumberFromPortName
  17585. æFc EPPC.h
  17586. æT Function
  17587. æTN A88F
  17588. æD pascal OSErr GetProcessSerialNumberFromPortName(PortNamePtr portName,ProcessSerialNumberPtr pPSN)
  17589.     = {0x3F3C,0x0035,0xA88F}; 
  17590. æDT OSErr myVariable = GetProcessSerialNumberFromPortName((PortNamePtr) portName,(ProcessSerialNumberPtr) pPSN);
  17591. æC 
  17592.  
  17593. æKY GetPortNameFromProcessSerialNumber
  17594. æFc EPPC.h
  17595. æT Function
  17596. æTN A88F
  17597. æD pascal OSErr GetPortNameFromProcessSerialNumber(PortNamePtr portName,ProcessSerialNumberPtr pPSN)
  17598.     = {0x3F3C,0x0046,0xA88F}; 
  17599. æDT OSErr myVariable = GetPortNameFromProcessSerialNumber((PortNamePtr) portName,(ProcessSerialNumberPtr) pPSN);
  17600. æC 
  17601.  
  17602. æKY GetSpecificHighLevelEvent
  17603. æFc EPPC.h
  17604. æT Function
  17605. æTN A88F
  17606. æD 
  17607. pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterProcPtr aFilter,
  17608.     unsigned long *params,OSErr *err)
  17609.     = {0x3F3C,0x0045,0xA88F}; 
  17610. æDT Boolean myVariable = GetSpecificHighLevelEvent((GetSpecificFilterProcPtr) aFilter,(
  17611.     unsigned long) * params,(OSErr *) err);
  17612. æC 
  17613. You can use the GetSpecificHighLevelEvent function to select and optionally
  17614. retrieve a specific high-level event from the high-level event queue.
  17615.  
  17616. You specify your filter function in the aFilter parameter.
  17617. GetSpecificHighLevelEvent calls your filter function once for each event on the
  17618. high-level event queue until your filter function returns TRUE or the end of the
  17619. queue is reached. You use the params parameter to specify the criteria your
  17620. filter function should use to select a specific event. For example, you can
  17621. specify the params parameter as a msgRefcon value to search for a particular
  17622. event or as a pointer to a targetID structure to search for a specific sender of
  17623. an event. Or you can search for a specific class of event.
  17624.  
  17625. Here’s how you declare the filter function aFilter:
  17626.  
  17627. FUNCTION aFilter (VAR params: LongInt; msgBuff: HighLevelEventMsgPtr;
  17628.                   sender: TargetID) : Boolean;
  17629.  
  17630. The params parameter indicates the criteria your filter function should use to
  17631. search for a specific event. The msgBuff parameter contains a pointer to a
  17632. record of type HighLevelEventMsg, which provides information about the event:
  17633. the event record for the high-level event, the posting options of the event, and
  17634. so forth. The sender parameter contains the target ID of the application that
  17635. sent the event.
  17636.  
  17637. Your filter function can compare the contents of the params parameter with the
  17638. contents of the msgBuff or senderID parameters. If your filter function finds a
  17639. match, your filter function should return TRUE. If it does not find a match,
  17640. your filter function should return FALSE.
  17641.  
  17642.  
  17643. æKY ErrMgr.h
  17644. æKL AddErrInsert
  17645. addInserts
  17646. CloseErrMgr
  17647. GetSysErrText
  17648. GetToolErrText
  17649. InitErrMgr
  17650.  
  17651.  
  17652. æKY AddErrInsert
  17653. æFc ErrMgr.h
  17654. æT Function
  17655. æD void AddErrInsert(unsigned char *insert,unsigned char *msgString);
  17656. æDT AddErrInsert((unsigned char *)insert,(unsigned char *)msgString);
  17657. æC 
  17658. /* 
  17659.     Add another insert to an error message string.This call is used when more
  17660.     than one insert is to be added to a message (because it contains more than
  17661.     one '^' character).
  17662. */
  17663.  
  17664. æKY addInserts
  17665. æFc ErrMgr.h
  17666. æT Function
  17667. æD unsigned char *addInserts(unsigned char *msgString,unsigned char *insert,
  17668.     ...);
  17669. æDT unsigned char myVariable = addInserts((unsigned char *)msgString,(unsigned char *)insert,
  17670.     (...));
  17671. æC 
  17672. /* 
  17673.     Add a set of inserts to an error message string.  AddErrInsert is called for
  17674.     each insert parameter specified.
  17675. */
  17676.  
  17677. æKY CloseErrMgr
  17678. æFc ErrMgr.h
  17679. æT Function
  17680. æD void CloseErrMgr(void);
  17681. æDT CloseErrMgr();
  17682. æC 
  17683. /* 
  17684.     Ideally a CloseErrMgr should be done at the end of execution to make sure all
  17685.     files opened by the ErrMgr are closed.  You can let normal program termination
  17686.     do the closing.  But if you are a purist...
  17687. */
  17688.  
  17689. æKY GetSysErrText
  17690. æFc ErrMgr.h
  17691. æT Function
  17692. æD char *GetSysErrText(short msgNbr,char *errMsg);
  17693. æDT char myVariable = GetSysErrText((short)msgNbr,(char *)errMsg);
  17694. æC 
  17695. /* 
  17696.     Get the error message text corresponding to system error number errNbr from
  17697.     the system error message file (whose name was specified in the InitErrMgr
  17698.     call).  The text of the message is returned in errMsg and the function returns
  17699.     a pointer to errMsg.  The maximum length of the message is limited to 254
  17700.     characters.
  17701.     
  17702.     Note, if a system message filename was not specified to InitErrMgr, then the
  17703.     ErrMgr assumes the message file contained in the file "SysErrs.Err".  This
  17704.     file is first accessed as "{ShellDirectory}SysErrs.Err" on the assumption that
  17705.     SysErrs.Err is kept in the same directory as the MPW Shell.  If the file
  17706.     cannot be opened, then an open is attempted on "SysErrs.Err" in the System
  17707.     Folder.
  17708. */
  17709.  
  17710.  
  17711. æKY GetToolErrText
  17712. æFc ErrMgr.h
  17713. æT Function
  17714. æD char *GetToolErrText(short msgNbr,char *errInsert,char *errMsg);
  17715. æDT char myVariable = GetToolErrText((short)msgNbr,(char *)errInsert,(char *)errMsg);
  17716. æC 
  17717. /* 
  17718.     Get the error message text corresponding to tool error number errNbr from
  17719.     the tool error message file (whose name was specified in the InitErrMgr
  17720.     call).  The text of the message is returned in errMsg and the function returns
  17721.     a pointer to errMsg.  The maximum length of the message is limited to 254
  17722.     characters.  If the message is to have an insert, then ErrInsert should be a
  17723.     pointer to it.  Otherwise it should be either be a null string or a NULL
  17724.     pointer.
  17725.     
  17726.     Inserts are indicated in error messages by specifying a '^' to indicate where
  17727.     the insert is to be placed.
  17728.     
  17729.     Note, if a tool message filename was not specified to InitErrMgr, then the
  17730.     ErrMgr assumes the message file contained in the data fork of the tool calling
  17731.     the ErrMgr.  This name is contained in the Shell variable {Command} and the
  17732.     value of that variable is used to open the error message file.
  17733. */
  17734.  
  17735. æKY InitErrMgr
  17736. æFc ErrMgr.h
  17737. æT Function
  17738. æD void InitErrMgr(char *toolErrFilename,char *sysErrFilename,Boolean showToolErrNbrs);
  17739. æDT InitErrMgr((char *)toolErrFilename,(char *)sysErrFilename,
  17740.     (Boolean)showToolErrNbrs);
  17741. æC 
  17742. /* 
  17743.     ErrMgr initialization.This must be done before using any other ErrMgr
  17744.     routine.  Set showToolErrNbrs to true if you want all tool messages to contain
  17745.     the error number following the message text enclosed in parentheses (e.g.,
  17746.     "<msg txt> ([OS] Error <n>)"; system error messages always contain the error 
  17747.     number).  The toolErrFileName parameter is used to specify the name of a 
  17748.     tool-specific error file, and should be the NULL or a null string if not used
  17749.     (or if the tool's data fork is to be used as the error file, see
  17750.     GetToolErrText for futher details). The sysErrFileName parameter is used to
  17751.     specify the name of a system error file, and should normally be the NULL or a
  17752.     null string, which causes the ErrMgr to look in the MPW Shell directory for
  17753.     "SysErrs.Err" (see GetSysErrText).
  17754.     
  17755.     If InitErrMgr is NOT called prior to calling GetSysErrText or GetToolErrText,
  17756.     then those routines, the first time they are called, will call InitErrMgr as
  17757.     InitErrMgr(NULL, NULL, true).
  17758.     
  17759.     The following global may be set to true to allow a C caller to process all
  17760.     strings as Pascal strings:*/
  17761.     
  17762.     extern Boolean pascalStrings;   /* set to true for Pascal strings*//*
  17763.     
  17764.     This should be set PRIOR to calling InitErrMgr.  Once set, ALL strings, both
  17765.     those passed to the ErrMgr as filenames and error message inserts, as well as
  17766.     the messages returned by the ErrMgr will be Pascal strings.  There is NO
  17767.     guarantee a '\0' byte is at the end of the string.  Results are unpredictable
  17768.     if pascalStringsis set false after it has been set true!
  17769.     
  17770. */
  17771.  
  17772.  
  17773. æKY ErrNo.h
  17774. æFc ErrNo.h
  17775. æC Synopsis
  17776.  
  17777. #include <ErrNo.h>
  17778. extern int errno;
  17779. extern short MacOSErr;
  17780.  
  17781.                            Description
  17782.  
  17783. Many of the Standard C Library functions can return, in 
  17784. addition to their normal return values, a negative value 
  17785. indicating an error, typically –1. For example, a function 
  17786. returning a character as an int will indicate an error by 
  17787. returning –1, which is not a legitimate ASCII value. (See the 
  17788. Descriptions of individual functions for details.) The external 
  17789. variable errno also provides an error number. Variable errno is 
  17790. not cleared on successful calls, so it should be tested only if 
  17791. the return value indicates an error.
  17792.  
  17793. The error name appears in brackets following the text in a 
  17794. library function description: for example,
  17795. “The next attempt to write a nonzero number of bytes will 
  17796. signal an error. [ENOSPC]”
  17797.  
  17798. Not all possible error numbers are listed for each library 
  17799. function because many errors are possible for most of the 
  17800. calls. Some UNIX operating system error numbers do not apply 
  17801. to Macintosh and are not documented in this manual. Some calls 
  17802. go to the Macintosh ROM and return a value in MacOSErr as well 
  17803. as the value in errno.
  17804.  
  17805. Table 3-2 is a list of the error numbers and their names as 
  17806. defined in the <ErrNo.h> file. Not all the error numbers listed 
  17807. here will be returned, but they are included in the header file 
  17808. for compatibility.
  17809.  
  17810. Table 3-2    I/O errors
  17811. Value    Identifier  Message Explanation
  17812.  
  17813.   1      EPERM       No permission match An attempt was made to 
  17814.                      modify a file in some way forbidden except to its 
  17815.                      creator.
  17816.   2      ENOENT      No such file or directory   A file whose filename is 
  17817.                      specified does not exist, or one of the directories 
  17818.                      in a pathname does not exist.
  17819.   3      ENORSRC     Resource not found  A required resource was not found.
  17820.                      This error applies to faccess calls that return tab, 
  17821.                      font, or print record information.
  17822.   4      EINTR       System service interrupted  A requested system 
  17823.                      call cannot be completed. 
  17824.                      This error may occur if a request to rename a file 
  17825.                      is unsuccessful.
  17826.   5      EIO         I/O error   Some physical I/O error has occurred. 
  17827.                      This error may in some cases be signaled on a call 
  17828.                      following the one to which it actually applies.
  17829.   6      ENXIO       No such device or address   I/O on a special file 
  17830.                      refers to a subdevice that does not exist, or the I/O 
  17831.                      is beyond the limits of the device. This error 
  17832.                      may also occur when, for example, no disk is 
  17833.                      present in a drive.
  17834.   7      E2BIG       Insufficient space for  The data to be returned 
  17835.                      is too large for the space allocated to receive it.
  17836.   9      EBADF       Bad file number Either a file descriptor 
  17837.                      does not refer to an open file, or a read (or write) 
  17838.                      request is made to a file that is open only for 
  17839.                      writing (or reading).
  17840.  12      ENOMEM      Not enough space. The system ran out of 
  17841.                      memory while the library call was executing.
  17842.  13      EACCES      Permission denied. An attempt was made to access 
  17843.                      a file in a way forbidden by the protection system.
  17844.  14      EFAULT      Illegal filename. A filename or volume name was too 
  17845.                      long or otherwise illegal.
  17846.  15      ENOTBLK     Block device required. A non-block file was 
  17847.                      used when a block device was required.
  17848.  16      EBUSY       Device or resource busy. An attempt was made to 
  17849.                      mount a volume that was already mounted, or to 
  17850.                      delete a locked file.
  17851.  17      EEXIST      File exists. An existing file was mentioned in an 
  17852.                      inappropriate context; for example, open(file, 
  17853.                      O_CREAT+O_EXCL).
  17854.  18      EXDEV       Cross-device link. A link to a file on another 
  17855.                      device was attempted.
  17856.  19      ENODEV      No such device. An attempt was made to apply an 
  17857.                      inappropriate system call to a device; 
  17858.                      for example, read a write-only device.
  17859.  20      ENOTDIR     Not a directory. An object that is not a directory
  17860.                      was specified where a directory is required; 
  17861.                      for example, in a path prefix.
  17862.  21      EISDIR      Is a directory. An attempt was made to 
  17863.                      write on a directory.
  17864.  22      EINVAL      Invalid parameter. Some invalid parameter 
  17865.                      was provided to a library function.
  17866.  23      ENFILE      File table overflow. The system’s table of open
  17867.                      files is full, so temporarily a call to open 
  17868.                      cannot be accepted.
  17869.  24      EMFILE      Too many open files. The system cannot allocate
  17870.                      memory to record another open file.
  17871.  25      ENOTTY      Not a typewriter. The specified file isn’t a 
  17872.                      character file.
  17873.  26      ETXTBSY     Text file busy. An attempt was made to open
  17874.                      a file that was already open for writing.
  17875.  27      EFBIG       File too large. The size of a file was 
  17876.                      larger than the maximum file size.
  17877.  28      ENOSPC      No space left on device. During a write to a file, 
  17878.                      there is no free space left on the device.
  17879.  29      ESPIPE      Illegal seek. An lseek was issued incorrectly.
  17880.  30      EROFS       Read-only file system. An attempt to modify a 
  17881.                      file or directory was made on a device 
  17882.                      mounted for read-only access.
  17883.  31      EMLINK      Too many links. An attempt to delete an 
  17884.                      open file was made.
  17885.  33      EDOM        Math arg out of domain of func. The argument of a 
  17886.                      math function is outside the domain of the 
  17887.                      function.
  17888.  34      ERANGE      Math result not representable. The value of a math 
  17889.                      function can’t be represented within the 
  17890.                      machine’s precision.
  17891.  
  17892.                            Note
  17893.  
  17894. Calls that interface to the Macintosh I/O system (such as open, 
  17895. close, read, write, and ioctl) can set the external variable 
  17896. MacOSErr as well as errno on errors. This section documents the 
  17897. errno values. The equivalent Macintosh ROM error-return 
  17898. values set in MacOSErr are documented in the System Error 
  17899. Handler chapter of Inside Macintosh.
  17900.  
  17901. See also
  17902. hypot, signal, perror, creat, open, close, read, write, ioctl
  17903.  
  17904.  
  17905. æKY Errors.h
  17906. æKL SysError
  17907.  
  17908. abortErr
  17909. addRefFailed
  17910. addResFailed
  17911. afpAccessDenied
  17912. afpAuthContinue
  17913. afpBadUAM
  17914. afpBadVersNum
  17915. afpBitmapErr
  17916. afpCallNotSupported
  17917. afpCantMove
  17918. afpCantRename
  17919. afpDenyConflict
  17920. afpDirNotEmpty
  17921. afpDirNotFound
  17922. afpDiskFull
  17923. afpEofError
  17924. afpFileBusy
  17925. afpFlatVol
  17926. afpIconTypeError
  17927. afpItemNotFound
  17928. afpLockErr
  17929. afpMiscErr
  17930. afpNoMoreLocks
  17931. afpNoServer
  17932. afpObjectExists
  17933. afpObjectLocked
  17934. afpObjectNotFound
  17935. afpObjectTypeErr
  17936. afpParmErr
  17937. afpRangeNotLocked
  17938. afpRangeOverlap
  17939. afpServerGoingDown
  17940. afpSessClosed
  17941. afpTooManyFilesOpen
  17942. afpUserNotAuth
  17943. afpVolLocked
  17944. aspBadVersNum
  17945. aspBufTooSmall
  17946. aspNoAck
  17947. aspNoMoreSess
  17948. aspNoServers
  17949. aspParamErr
  17950. aspServerBusy
  17951. aspSessClosed
  17952. aspSizeErr
  17953. aspTooMany
  17954. atpBadRsp
  17955. atpLenErr
  17956. badATPSkt
  17957. badBtSlpErr
  17958. badBuffNum
  17959. badChannel
  17960. badCksmErr
  17961. badDBtSlp
  17962. badDCksum
  17963. badEditionFileErr
  17964. badFormat
  17965. badMDBErr
  17966. badMovErr
  17967. badSectionErr
  17968. badSubPartErr
  17969. badUnitErr
  17970. bdNamErr
  17971. breakRecd
  17972. buf2SmallErr
  17973. cantStepErr
  17974. catChangedErr
  17975. cbNotFound
  17976. cDevErr
  17977. ckSumErr
  17978. clkRdErr
  17979. clkWrErr
  17980. closErr
  17981. cMatchErr
  17982. cNoMemErr
  17983. containerAlreadyOpenWrn
  17984. containerNotFoundWrn
  17985. controlErr
  17986. corErr
  17987. cProtectErr
  17988. cRangeErr
  17989. cResErr
  17990. cTempMemErr
  17991. dataVerErr
  17992. dceExtErr
  17993. ddpLenErr
  17994. ddpSktErr
  17995. DiffVolErr
  17996. dInstErr
  17997. dirFulErr
  17998. dirNFErr
  17999. dRemovErr
  18000. dsAddressErr
  18001. dsBadLaunch
  18002. dsBadPatch
  18003. dsBadSANEopcode
  18004. dsBadSlotInt
  18005. dsBusError
  18006. dsChkErr
  18007. dsCoreErr
  18008. dsFinderErr
  18009. dsFPErr
  18010. dsFSErr
  18011. dsGreeting
  18012. dsHMenuFindErr
  18013. dsIllInstErr
  18014. dsIOCoreErr
  18015. dsIrqErr
  18016. dskFulErr
  18017. dsLineAErr
  18018. dsLineFErr
  18019. dsLoadErr
  18020. dsMBarNFnd
  18021. dsMemFullErr
  18022. dsMiscErr
  18023. dsNoPackErr
  18024. dsNoPatch
  18025. dsNoPk1
  18026. dsNoPk2
  18027. dsNoPk3
  18028. dsNoPk4
  18029. dsNoPk5
  18030. dsNoPk6
  18031. dsNoPk7
  18032. dsNotThe1
  18033. dsOvflowErr
  18034. dsPrivErr
  18035. dsReinsert
  18036. dsStknHeap
  18037. dsSysErr
  18038. dsTraceErr
  18039. dsZeroDivErr
  18040. dupFNErr
  18041. editionMgrInitErr
  18042. envBadVers
  18043. envNotPresent
  18044. envVersTooBig
  18045. eofErr
  18046. evtNotEnb
  18047. excessCollsns
  18048. extFSErr
  18049. extractErr
  18050. exUserBreak
  18051. fBsyErr
  18052. fidExists
  18053. fidNotFound
  18054. firstDskErr
  18055. fLckdErr
  18056. fmt1Err
  18057. fmt2Err
  18058. fnfErr
  18059. fnOpnErr
  18060. fontDecError
  18061. fontNotDeclared
  18062. fontSubErr
  18063. framingErr
  18064. fsDSIntErr
  18065. fsRnErr
  18066. gcrOnMFMErr
  18067. gfpErr
  18068. hMenuFindErr
  18069. hwOverrunErr
  18070. hwParamErr
  18071. iIOAbortErr
  18072. initIWMErr
  18073. ioErr
  18074. lapProtErr
  18075. lastDskErr
  18076. MacOSErr
  18077. mapReadErr
  18078. mBarNFnd
  18079. memAdrErr
  18080. memAZErr
  18081. memBCErr
  18082. memFullErr
  18083. memLockedErr
  18084. memPCErr
  18085. memPurErr
  18086. memROZErr
  18087. memROZWarn
  18088. memSCErr
  18089. memWZErr
  18090. menuPrgErr
  18091. mFulErr
  18092. multiplePublisherWrn
  18093. nbpBuffOvr
  18094. nbpConfDiff
  18095. nbpDuplicate
  18096. nbpNISErr
  18097. nbpNoConfirm
  18098. nbpNotFound
  18099. negZcbFreeErr
  18100. nilHandleErr
  18101. nmTypErr
  18102. noAdrMkErr
  18103. noBridgeErr
  18104. noDataArea
  18105. noDriveErr
  18106. noDtaMkErr
  18107. noHardware
  18108. noMacDskErr
  18109. noMPPErr
  18110. noNybErr
  18111. noRelErr
  18112. noScrapErr
  18113. noSendResp
  18114. NotAFileErr
  18115. notEnoughHardware
  18116. notOpenErr
  18117. notRegisteredSectionErr
  18118. notThePublisherWrn
  18119. noTypeErr
  18120. nsDrvErr
  18121. nsvErr
  18122. offLinErr
  18123. openErr
  18124. opWrErr
  18125. paramErr
  18126. parityErr
  18127. permErr
  18128. pixMapTooDeepErr
  18129. portInUse
  18130. portNotCf
  18131. posErr
  18132. prInitErr
  18133. prWrErr
  18134. qErr
  18135. queueFull
  18136. rcvrErr
  18137. readErr
  18138. readQErr
  18139. recNotFnd
  18140. reqAborted
  18141. reqFailed
  18142. resAttrErr
  18143. resFNotFound
  18144. resNotFound
  18145. resProblem
  18146. rfNumErr
  18147. rgnTooBigErr
  18148. rmvRefFailed
  18149. rmvResFailed
  18150. sdmInitErr
  18151. sdmJTInitErr
  18152. sdmPRAMInitErr
  18153. sdmPriInitErr
  18154. sdmSRTInitErr
  18155. sectNFErr
  18156. seekErr
  18157. seNoDB
  18158. shutDownAlert
  18159. siInitSDTblErr
  18160. siInitSPTblErr
  18161. siInitVBLQsErr
  18162. sktClosedErr
  18163. slotNumErr
  18164. smBadBoardId
  18165. smBadRefId
  18166. smBadsList
  18167. smBadsPtrErr
  18168. smBLFieldBad
  18169. smBlkMoveErr
  18170. smBusErrTO
  18171. smByteLanesErr
  18172. smCkStatusErr
  18173. smCodeRevErr
  18174. smCPUErr
  18175. smCRCFail
  18176. smDisDrvrNamErr
  18177. smDisposePErr
  18178. smEmptySlot
  18179. smFHBlockRdErr
  18180. smFormatErr
  18181. smGetDrvrNamErr
  18182. smGetPRErr
  18183. smInitStatVErr
  18184. smInitTblErr
  18185. smLWTstBad
  18186. smNewPErr
  18187. smNilsBlockErr
  18188. smNoBoardId
  18189. smNoBoardsRsrc
  18190. smNoDir
  18191. smNoGoodOpens
  18192. smNoJmpTbl
  18193. smNoMoresRsrcs
  18194. smNosInfoArray
  18195. smOffsetErr
  18196. smPRAMInitErr
  18197. smPriInitErr
  18198. smRecNotFnd
  18199. smReservedErr
  18200. smResrvErr
  18201. smRevisionErr
  18202. smSDMInitErr
  18203. smSelOOBErr
  18204. smsGetDrvrErr
  18205. smSlotOOBErr
  18206. smsPointerNil
  18207. smSRTInitErr
  18208. smSRTOvrFlErr
  18209. smUnExBusErr
  18210. spdAdjErr
  18211. statusErr
  18212. strUserBreak
  18213. svDisabled
  18214. svTempDisable
  18215. swOverrunErr
  18216. teScrapSizeErr
  18217. tk0BadErr
  18218. tmfoErr
  18219. tmwdoErr
  18220. tooManyReqs
  18221. tooManySkts
  18222. twoSideErr
  18223. unimpErr
  18224. unitEmptyErr
  18225. unitTblFullErr
  18226. updPixMemErr
  18227. userBreak
  18228. userCanceledErr
  18229. verErr
  18230. vLckdErr
  18231. volGoneErr
  18232. volOffLinErr
  18233. volOnLinErr
  18234. vTypErr
  18235. wPrErr
  18236. wrgVolTypErr
  18237. writErr
  18238. wrPermErr
  18239. wrUnderrun
  18240.  
  18241. æKY qErr
  18242. æFc Errors.h
  18243. æT #define
  18244. æD #define qErr -1 /*queue element not found during deletion*/
  18245. æC 
  18246.  
  18247. æKY vTypErr
  18248. æFc Errors.h
  18249. æT #define
  18250. æD #define vTypErr -2 /*invalid queue element*/
  18251. æC 
  18252.  
  18253. æKY corErr
  18254. æFc Errors.h
  18255. æT #define
  18256. æD #define corErr -3 /*core routine number out of range*/
  18257. æC 
  18258.  
  18259. æKY unimpErr
  18260. æFc Errors.h
  18261. æT #define
  18262. æD #define unimpErr -4 /*unimplemented core routine*/
  18263. æC 
  18264.  
  18265. æKY seNoDB
  18266. æFc Errors.h
  18267. æT #define
  18268. æD #define seNoDB -8 /*no debugger installed to handle debugger command*/
  18269. æC 
  18270.  
  18271. æKY controlErr
  18272. æFc Errors.h
  18273. æT #define
  18274. æD #define controlErr -17 /*I/O System Errors*/
  18275. æC 
  18276.  
  18277. æKY statusErr
  18278. æFc Errors.h
  18279. æT #define
  18280. æD #define statusErr -18 /*I/O System Errors*/
  18281. æC 
  18282.  
  18283. æKY readErr
  18284. æFc Errors.h
  18285. æT #define
  18286. æD #define readErr -19 /*I/O System Errors*/
  18287. æC 
  18288.  
  18289. æKY writErr
  18290. æFc Errors.h
  18291. æT #define
  18292. æD #define writErr -20 /*I/O System Errors*/
  18293. æC 
  18294.  
  18295. æKY badUnitErr
  18296. æFc Errors.h
  18297. æT #define
  18298. æD #define badUnitErr -21 /*I/O System Errors*/
  18299. æC 
  18300.  
  18301. æKY unitEmptyErr
  18302. æFc Errors.h
  18303. æT #define
  18304. æD #define unitEmptyErr -22 /*I/O System Errors*/
  18305. æC 
  18306.  
  18307. æKY openErr
  18308. æFc Errors.h
  18309. æT #define
  18310. æD #define openErr -23 /*I/O System Errors*/
  18311. æC 
  18312.  
  18313. æKY closErr
  18314. æFc Errors.h
  18315. æT #define
  18316. æD #define closErr -24 /*I/O System Errors*/
  18317. æC 
  18318.  
  18319. æKY dRemovErr
  18320. æFc Errors.h
  18321. æT #define
  18322. æD #define dRemovErr -25 /*tried to remove an open driver*/
  18323. æC 
  18324.  
  18325. æKY dInstErr
  18326. æFc Errors.h
  18327. æT #define
  18328. æD #define dInstErr -26 /*DrvrInstall couldn't find driver in resources */
  18329. æC 
  18330.  
  18331. æKY abortErr
  18332. æFc Errors.h
  18333. æT #define
  18334. æD #define abortErr -27 /*IO call aborted by KillIO*/
  18335. æC 
  18336.  
  18337. æKY iIOAbortErr
  18338. æFc Errors.h
  18339. æT #define
  18340. æD #define iIOAbortErr -27 /*IO abort error (Printing Manager)*/
  18341. æC 
  18342.  
  18343. æKY notOpenErr
  18344. æFc Errors.h
  18345. æT #define
  18346. æD #define notOpenErr -28 /*Couldn't rd/wr/ctl/sts cause driver not opened*/
  18347. æC 
  18348.  
  18349. æKY dirFulErr
  18350. æFc Errors.h
  18351. æT #define
  18352. æD #define dirFulErr -33 /*Directory full*/
  18353. æC 
  18354.  
  18355. æKY dskFulErr
  18356. æFc Errors.h
  18357. æT #define
  18358. æD #define dskFulErr -34 /*disk full*/
  18359. æC 
  18360.  
  18361. æKY nsvErr
  18362. æFc Errors.h
  18363. æT #define
  18364. æD #define nsvErr -35 /*no such volume*/
  18365. æC 
  18366.  
  18367. æKY ioErr
  18368. æFc Errors.h
  18369. æT #define
  18370. æD #define ioErr -36 /*I/O error (bummers)*/
  18371. æC 
  18372.  
  18373. æKY bdNamErr
  18374. æFc Errors.h
  18375. æT #define
  18376. æD #define bdNamErr -37 /*there may be no bad names in the final system!*/
  18377. æC 
  18378.  
  18379. æKY fnOpnErr
  18380. æFc Errors.h
  18381. æT #define
  18382. æD #define fnOpnErr -38 /*File not open*/
  18383. æC 
  18384.  
  18385. æKY eofErr
  18386. æFc Errors.h
  18387. æT #define
  18388. æD #define eofErr -39 /*End of file*/
  18389. æC 
  18390.  
  18391. æKY posErr
  18392. æFc Errors.h
  18393. æT #define
  18394. æD #define posErr -40 /*tried to position to before start of file (r/w)*/
  18395. æC 
  18396.  
  18397. æKY mFulErr
  18398. æFc Errors.h
  18399. æT #define
  18400. æD #define mFulErr -41 /*memory full (open) or file won't fit (load)*/
  18401. æC 
  18402.  
  18403. æKY tmfoErr
  18404. æFc Errors.h
  18405. æT #define
  18406. æD #define tmfoErr -42 /*too many files open*/
  18407. æC 
  18408.  
  18409. æKY fnfErr
  18410. æFc Errors.h
  18411. æT #define
  18412. æD #define fnfErr -43 /*File not found*/
  18413. æC 
  18414.  
  18415. æKY wPrErr
  18416. æFc Errors.h
  18417. æT #define
  18418. æD #define wPrErr -44 /*diskette is write protected.*/
  18419. æC 
  18420.  
  18421. æKY fLckdErr
  18422. æFc Errors.h
  18423. æT #define
  18424. æD #define fLckdErr -45 /*file is locked*/
  18425. æC 
  18426.  
  18427. æKY vLckdErr
  18428. æFc Errors.h
  18429. æT #define
  18430. æD #define vLckdErr -46 /*volume is locked*/
  18431. æC 
  18432.  
  18433. æKY fBsyErr
  18434. æFc Errors.h
  18435. æT #define
  18436. æD #define fBsyErr -47 /*File is busy (delete)*/
  18437. æC 
  18438.  
  18439. æKY dupFNErr
  18440. æFc Errors.h
  18441. æT #define
  18442. æD #define dupFNErr -48 /*duplicate filename (rename)*/
  18443. æC 
  18444.  
  18445. æKY opWrErr
  18446. æFc Errors.h
  18447. æT #define
  18448. æD #define opWrErr -49 /*file already open with with write permission*/
  18449. æC 
  18450.  
  18451. æKY paramErr
  18452. æFc Errors.h
  18453. æT #define
  18454. æD #define paramErr -50 /*error in user parameter list*/
  18455. æC 
  18456.  
  18457. æKY rfNumErr
  18458. æFc Errors.h
  18459. æT #define
  18460. æD #define rfNumErr -51 /*refnum error*/
  18461. æC 
  18462.  
  18463. æKY gfpErr
  18464. æFc Errors.h
  18465. æT #define
  18466. æD #define gfpErr -52 /*get file position error*/
  18467. æC 
  18468.  
  18469. æKY volOffLinErr
  18470. æFc Errors.h
  18471. æT #define
  18472. æD #define volOffLinErr -53 /*volume not on line error (was Ejected)*/
  18473. æC 
  18474.  
  18475. æKY permErr
  18476. æFc Errors.h
  18477. æT #define
  18478. æD #define permErr -54 /*permissions error (on file open)*/
  18479. æC 
  18480.  
  18481. æKY pixMapTooDeepErr
  18482. æFc Errors.h
  18483. æT #define
  18484. æD #define pixMapTooDeepErr -148
  18485. æC 
  18486.  
  18487. æKY volOnLinErr
  18488. æFc Errors.h
  18489. æT #define
  18490. æD #define volOnLinErr -55 /*drive volume already on-line at MountVol*/
  18491. æC 
  18492.  
  18493. æKY nsDrvErr
  18494. æFc Errors.h
  18495. æT #define
  18496. æD #define nsDrvErr -56 /*no such drive (tried to mount a bad drive num)*/
  18497. æC 
  18498.  
  18499. æKY noMacDskErr
  18500. æFc Errors.h
  18501. æT #define
  18502. æD #define noMacDskErr -57 /*not a mac diskette (sig bytes are wrong)*/
  18503. æC 
  18504.  
  18505. æKY extFSErr
  18506. æFc Errors.h
  18507. æT #define
  18508. æD #define extFSErr -58 /*volume in question belongs to an external fs*/
  18509. æC 
  18510.  
  18511. æKY fsRnErr
  18512. æFc Errors.h
  18513. æT #define
  18514. æD #define fsRnErr -59 /*file system internal error:during rename the old entry was deleted but could not be restored.*/
  18515. æC 
  18516.  
  18517. æKY badMDBErr
  18518. æFc Errors.h
  18519. æT #define
  18520. æD #define badMDBErr -60 /*bad master directory block*/
  18521. æC 
  18522.  
  18523. æKY wrPermErr
  18524. æFc Errors.h
  18525. æT #define
  18526. æD #define wrPermErr -61 /*write permissions error*/
  18527. æC 
  18528.  
  18529. æKY fontDecError
  18530. æFc Errors.h
  18531. æT #define
  18532. æD #define fontDecError -64 /*error during font declaration*/
  18533. æC 
  18534.  
  18535. æKY lastDskErr
  18536. æFc Errors.h
  18537. æT #define
  18538. æD #define lastDskErr -64 /*I/O System Errors*/
  18539. æC 
  18540.  
  18541. æKY noDriveErr
  18542. æFc Errors.h
  18543. æT #define
  18544. æD #define noDriveErr -64 /*drive not installed*/
  18545. æC 
  18546.  
  18547. æKY offLinErr
  18548. æFc Errors.h
  18549. æT #define
  18550. æD #define offLinErr -65 /*r/w requested for an off-line drive*/
  18551. æC 
  18552.  
  18553. æKY fontNotDeclared
  18554. æFc Errors.h
  18555. æT #define
  18556. æD #define fontNotDeclared -65 /*font not declared*/
  18557. æC 
  18558.  
  18559. æKY noNybErr
  18560. æFc Errors.h
  18561. æT #define
  18562. æD #define noNybErr -66 /*couldn't find 5 nybbles in 200 tries*/
  18563. æC 
  18564.  
  18565. æKY fontSubErr
  18566. æFc Errors.h
  18567. æT #define
  18568. æD #define fontSubErr -66 /*font substitution occured*/
  18569. æC 
  18570.  
  18571. æKY noAdrMkErr
  18572. æFc Errors.h
  18573. æT #define
  18574. æD #define noAdrMkErr -67 /*couldn't find valid addr mark*/
  18575. æC 
  18576.  
  18577. æKY dataVerErr
  18578. æFc Errors.h
  18579. æT #define
  18580. æD #define dataVerErr -68 /*read verify compare failed*/
  18581. æC 
  18582.  
  18583. æKY badCksmErr
  18584. æFc Errors.h
  18585. æT #define
  18586. æD #define badCksmErr -69 /*addr mark checksum didn't check*/
  18587. æC 
  18588.  
  18589. æKY badBtSlpErr
  18590. æFc Errors.h
  18591. æT #define
  18592. æD #define badBtSlpErr -70 /*bad addr mark bit slip nibbles*/
  18593. æC 
  18594.  
  18595. æKY noDtaMkErr
  18596. æFc Errors.h
  18597. æT #define
  18598. æD #define noDtaMkErr -71 /*couldn't find a data mark header*/
  18599. æC 
  18600.  
  18601. æKY badDCksum
  18602. æFc Errors.h
  18603. æT #define
  18604. æD #define badDCksum -72 /*bad data mark checksum*/
  18605. æC 
  18606.  
  18607. æKY badDBtSlp
  18608. æFc Errors.h
  18609. æT #define
  18610. æD #define badDBtSlp -73 /*bad data mark bit slip nibbles*/
  18611. æC 
  18612.  
  18613. æKY wrUnderrun
  18614. æFc Errors.h
  18615. æT #define
  18616. æD #define wrUnderrun -74 /*write underrun occurred*/
  18617. æC 
  18618.  
  18619. æKY cantStepErr
  18620. æFc Errors.h
  18621. æT #define
  18622. æD #define cantStepErr -75 /*step handshake failed*/
  18623. æC 
  18624.  
  18625. æKY tk0BadErr
  18626. æFc Errors.h
  18627. æT #define
  18628. æD #define tk0BadErr -76 /*track 0 detect doesn't change*/
  18629. æC 
  18630.  
  18631. æKY initIWMErr
  18632. æFc Errors.h
  18633. æT #define
  18634. æD #define initIWMErr -77 /*unable to initialize IWM*/
  18635. æC 
  18636.  
  18637. æKY twoSideErr
  18638. æFc Errors.h
  18639. æT #define
  18640. æD #define twoSideErr -78 /*tried to read 2nd side on a 1-sided drive*/
  18641. æC 
  18642.  
  18643. æKY spdAdjErr
  18644. æFc Errors.h
  18645. æT #define
  18646. æD #define spdAdjErr -79 /*unable to correctly adjust disk speed*/
  18647. æC 
  18648.  
  18649. æKY seekErr
  18650. æFc Errors.h
  18651. æT #define
  18652. æD #define seekErr -80 /*track number wrong on address mark*/
  18653. æC 
  18654.  
  18655. æKY sectNFErr
  18656. æFc Errors.h
  18657. æT #define
  18658. æD #define sectNFErr -81 /*sector number never found on a track*/
  18659. æC 
  18660.  
  18661. æKY fmt1Err
  18662. æFc Errors.h
  18663. æT #define
  18664. æD #define fmt1Err -82 /*can't find sector 0 after track format*/
  18665. æC 
  18666.  
  18667. æKY fmt2Err
  18668. æFc Errors.h
  18669. æT #define
  18670. æD #define fmt2Err -83 /*can't get enough sync*/
  18671. æC 
  18672.  
  18673. æKY verErr
  18674. æFc Errors.h
  18675. æT #define
  18676. æD #define verErr -84 /*track failed to verify*/
  18677. æC 
  18678.  
  18679. æKY firstDskErr
  18680. æFc Errors.h
  18681. æT #define
  18682. æD #define firstDskErr -84 /*I/O System Errors*/
  18683. æC 
  18684.  
  18685. æKY clkRdErr
  18686. æFc Errors.h
  18687. æT #define
  18688. æD #define clkRdErr -85 /*unable to read same clock value twice*/
  18689. æC 
  18690.  
  18691. æKY clkWrErr
  18692. æFc Errors.h
  18693. æT #define
  18694. æD #define clkWrErr -86 /*time written did not verify*/
  18695. æC 
  18696.  
  18697. æKY prWrErr
  18698. æFc Errors.h
  18699. æT #define
  18700. æD #define prWrErr -87 /*parameter ram written didn't read-verify*/
  18701. æC 
  18702.  
  18703. æKY prInitErr
  18704. æFc Errors.h
  18705. æT #define
  18706. æD #define prInitErr -88 /*InitUtil found the parameter ram uninitialized*/
  18707. æC 
  18708.  
  18709. æKY rcvrErr
  18710. æFc Errors.h
  18711. æT #define
  18712. æD #define rcvrErr -89 /*SCC receiver error (framing; parity; OR)*/
  18713. æC 
  18714.  
  18715. æKY breakRecd
  18716. æFc Errors.h
  18717. æT #define
  18718. æD #define breakRecd -90 /*Break received (SCC)*/
  18719. æC 
  18720.  
  18721. æKY ddpSktErr
  18722. æFc Errors.h
  18723. æT #define
  18724. æD #define ddpSktErr -91 /*error in soket number*/
  18725. æC 
  18726.  
  18727. æKY ddpLenErr
  18728. æFc Errors.h
  18729. æT #define
  18730. æD #define ddpLenErr -92 /*data length too big*/
  18731. æC 
  18732.  
  18733. æKY noBridgeErr
  18734. æFc Errors.h
  18735. æT #define
  18736. æD #define noBridgeErr -93 /*no network bridge for non-local send*/
  18737. æC 
  18738.  
  18739. æKY lapProtErr
  18740. æFc Errors.h
  18741. æT #define
  18742. æD #define lapProtErr -94 /*error in attaching/detaching protocol*/
  18743. æC 
  18744.  
  18745. æKY excessCollsns
  18746. æFc Errors.h
  18747. æT #define
  18748. æD #define excessCollsns -95 /*excessive collisions on write*/
  18749. æC 
  18750.  
  18751. æKY portInUse
  18752. æFc Errors.h
  18753. æT #define
  18754. æD #define portInUse -97 /*driver Open error code (port is in use)*/
  18755. æC 
  18756.  
  18757. æKY portNotCf
  18758. æFc Errors.h
  18759. æT #define
  18760. æD #define portNotCf -98 /*driver Open error code (parameter RAM not configured for this connection)*/
  18761. æC 
  18762.  
  18763. æKY memROZErr
  18764. æFc Errors.h
  18765. æT #define
  18766. æD #define memROZErr -99 /*hard error in ROZ*/
  18767. æC 
  18768.  
  18769. æKY noScrapErr
  18770. æFc Errors.h
  18771. æT #define
  18772. æD #define noScrapErr -100 /*No scrap exists error*/
  18773. æC 
  18774.  
  18775. æKY noTypeErr
  18776. æFc Errors.h
  18777. æT #define
  18778. æD #define noTypeErr -102 /*No object of that type in scrap*/
  18779. æC 
  18780.  
  18781. æKY memFullErr
  18782. æFc Errors.h
  18783. æT #define
  18784. æD #define memFullErr -108 /*Not enough room in heap zone*/
  18785. æC 
  18786.  
  18787. æKY nilHandleErr
  18788. æFc Errors.h
  18789. æT #define
  18790. æD #define nilHandleErr -109 /*Master Pointer was NIL in HandleZone or other*/
  18791. æC 
  18792.  
  18793. æKY memAdrErr
  18794. æFc Errors.h
  18795. æT #define
  18796. æD #define memAdrErr -110 /*address was odd; or out of range*/
  18797. æC 
  18798.  
  18799. æKY memWZErr
  18800. æFc Errors.h
  18801. æT #define
  18802. æD #define memWZErr -111 /*WhichZone failed (applied to free block)*/
  18803. æC 
  18804.  
  18805. æKY memPurErr
  18806. æFc Errors.h
  18807. æT #define
  18808. æD #define memPurErr -112 /*trying to purge a locked or non-purgeable block*/
  18809. æC 
  18810.  
  18811. æKY memAZErr
  18812. æFc Errors.h
  18813. æT #define
  18814. æD #define memAZErr -113 /*Address in zone check failed*/
  18815. æC 
  18816.  
  18817. æKY memPCErr
  18818. æFc Errors.h
  18819. æT #define
  18820. æD #define memPCErr -114 /*Pointer Check failed*/
  18821. æC 
  18822.  
  18823. æKY memBCErr
  18824. æFc Errors.h
  18825. æT #define
  18826. æD #define memBCErr -115 /*Block Check failed*/
  18827. æC 
  18828.  
  18829. æKY memSCErr
  18830. æFc Errors.h
  18831. æT #define
  18832. æD #define memSCErr -116 /*Size Check failed*/
  18833. æC 
  18834.  
  18835. æKY memLockedErr
  18836. æFc Errors.h
  18837. æT #define
  18838. æD #define memLockedErr -117 /*trying to move a locked block (MoveHHi)*/
  18839. æC 
  18840.  
  18841. æKY dirNFErr
  18842. æFc Errors.h
  18843. æT #define
  18844. æD #define dirNFErr -120 /*Directory not found*/
  18845. æC 
  18846.  
  18847. æKY tmwdoErr
  18848. æFc Errors.h
  18849. æT #define
  18850. æD #define tmwdoErr -121 /*No free WDCB available*/
  18851. æC 
  18852.  
  18853. æKY badMovErr
  18854. æFc Errors.h
  18855. æT #define
  18856. æD #define badMovErr -122 /*Move into offspring error*/
  18857. æC 
  18858.  
  18859. æKY wrgVolTypErr
  18860. æFc Errors.h
  18861. æT #define
  18862. æD #define wrgVolTypErr -123 /*Wrong volume type error [operation not supported for MFS]*/
  18863. æC 
  18864.  
  18865. æKY volGoneErr
  18866. æFc Errors.h
  18867. æT #define
  18868. æD #define volGoneErr -124 /*Server volume has been disconnected.*/
  18869. æC 
  18870.  
  18871. æKY fsDSIntErr
  18872. æFc Errors.h
  18873. æT #define
  18874. æD #define fsDSIntErr -127 /*Internal file system error*/
  18875. æC 
  18876.  
  18877. æKY userCanceledErr
  18878. æFc Errors.h
  18879. æT #define
  18880. æD #define userCanceledErr -128
  18881. æC 
  18882.  
  18883. æKY fidNotFound
  18884. æFc Errors.h
  18885. æT #define
  18886. æD #define fidNotFound -1300 /*no file thread exists.*/
  18887. æC 
  18888.  
  18889. æKY fidExists
  18890. æFc Errors.h
  18891. æT #define
  18892. æD #define fidExists -1301 /*file id already exists*/
  18893. æC 
  18894.  
  18895. æKY NotAFileErr
  18896. æFc Errors.h
  18897. æT #define
  18898. æD #define NotAFileErr -1302 /*directory specified*/
  18899. æC 
  18900.  
  18901. æKY DiffVolErr
  18902. æFc Errors.h
  18903. æT #define
  18904. æD #define DiffVolErr -1303 /*files on different volumes*/
  18905. æC 
  18906.  
  18907. æKY catChangedErr
  18908. æFc Errors.h
  18909. æT #define
  18910. æD #define catChangedErr -1304 /*the catalog has been modified*/
  18911. æC 
  18912.  
  18913. æKY resNotFound
  18914. æFc Errors.h
  18915. æT #define
  18916. æD #define resNotFound -192 /*Resource not found*/
  18917. æC 
  18918.  
  18919. æKY resFNotFound
  18920. æFc Errors.h
  18921. æT #define
  18922. æD #define resFNotFound -193 /*Resource file not found*/
  18923. æC 
  18924.  
  18925. æKY addResFailed
  18926. æFc Errors.h
  18927. æT #define
  18928. æD #define addResFailed -194 /*AddResource failed*/
  18929. æC 
  18930.  
  18931. æKY addRefFailed
  18932. æFc Errors.h
  18933. æT #define
  18934. æD #define addRefFailed -195 /*AddReference failed*/
  18935. æC 
  18936.  
  18937. æKY rmvResFailed
  18938. æFc Errors.h
  18939. æT #define
  18940. æD #define rmvResFailed -196 /*RmveResource failed*/
  18941. æC 
  18942.  
  18943. æKY rmvRefFailed
  18944. æFc Errors.h
  18945. æT #define
  18946. æD #define rmvRefFailed -197 /*RmveReference failed*/
  18947. æC 
  18948.  
  18949. æKY resAttrErr
  18950. æFc Errors.h
  18951. æT #define
  18952. æD #define resAttrErr -198 /*attribute inconsistent with operation*/
  18953. æC 
  18954.  
  18955. æKY mapReadErr
  18956. æFc Errors.h
  18957. æT #define
  18958. æD #define mapReadErr -199 /*map inconsistent with operation*/
  18959. æC 
  18960.  
  18961. æKY editionMgrInitErr
  18962. æFc Errors.h
  18963. æT #define
  18964. æD #define editionMgrInitErr -450 /*edition manager not inited by this app*/
  18965. æC 
  18966.  
  18967. æKY badSectionErr
  18968. æFc Errors.h
  18969. æT #define
  18970. æD #define badSectionErr -451 /*not a valid SectionRecord*/
  18971. æC 
  18972.  
  18973. æKY notRegisteredSectionErr
  18974. æFc Errors.h
  18975. æT #define
  18976. æD #define notRegisteredSectionErr -452 /*not a registered SectionRecord*/
  18977. æC 
  18978.  
  18979. æKY badEditionFileErr
  18980. æFc Errors.h
  18981. æT #define
  18982. æD #define badEditionFileErr -453 /*edition file is corrupt*/
  18983. æC 
  18984.  
  18985. æKY badSubPartErr
  18986. æFc Errors.h
  18987. æT #define
  18988. æD #define badSubPartErr -454 /*can not use sub parts in this release*/
  18989. æC 
  18990.  
  18991. æKY multiplePublisherWrn
  18992. æFc Errors.h
  18993. æT #define
  18994. æD #define multiplePublisherWrn -460 /*A Publisher is already registered for that container*/
  18995. æC 
  18996.  
  18997. æKY containerNotFoundWrn
  18998. æFc Errors.h
  18999. æT #define
  19000. æD #define containerNotFoundWrn -461 /*could not find editionContainer at this time*/
  19001. æC 
  19002.  
  19003. æKY containerAlreadyOpenWrn
  19004. æFc Errors.h
  19005. æT #define
  19006. æD #define containerAlreadyOpenWrn -462 /*container already opened by this section*/
  19007. æC 
  19008.  
  19009. æKY notThePublisherWrn
  19010. æFc Errors.h
  19011. æT #define
  19012. æD #define notThePublisherWrn -463 /*not the first registered publisher for that container*/
  19013. æC 
  19014.  
  19015. æKY userBreak
  19016. æFc Errors.h
  19017. æT #define
  19018. æD #define userBreak -490 /*user debugger break*/
  19019. æC 
  19020.  
  19021. æKY strUserBreak
  19022. æFc Errors.h
  19023. æT #define
  19024. æD #define strUserBreak -491 /*user debugger break; display string on stack*/
  19025. æC 
  19026.  
  19027. æKY exUserBreak
  19028. æFc Errors.h
  19029. æT #define
  19030. æD #define exUserBreak -492 /*user debugger break; execute debugger commands on stack*/
  19031. æC 
  19032.  
  19033. æKY nbpBuffOvr
  19034. æFc Errors.h
  19035. æT #define
  19036. æD #define nbpBuffOvr -1024 /*Buffer overflow in LookupName*/
  19037. æC 
  19038.  
  19039. æKY nbpNoConfirm
  19040. æFc Errors.h
  19041. æT #define
  19042. æD #define nbpNoConfirm -1025
  19043. æC 
  19044.  
  19045. æKY nbpConfDiff
  19046. æFc Errors.h
  19047. æT #define
  19048. æD #define nbpConfDiff -1026 /*Name confirmed at different socket*/
  19049. æC 
  19050.  
  19051. æKY nbpDuplicate
  19052. æFc Errors.h
  19053. æT #define
  19054. æD #define nbpDuplicate -1027 /*Duplicate name exists already*/
  19055. æC 
  19056.  
  19057. æKY nbpNotFound
  19058. æFc Errors.h
  19059. æT #define
  19060. æD #define nbpNotFound -1028 /*Name not found on remove*/
  19061. æC 
  19062.  
  19063. æKY nbpNISErr
  19064. æFc Errors.h
  19065. æT #define
  19066. æD #define nbpNISErr -1029 /*Error trying to open the NIS*/
  19067. æC 
  19068.  
  19069. æKY aspBadVersNum
  19070. æFc Errors.h
  19071. æT #define
  19072. æD #define aspBadVersNum -1066 /*Server cannot support this ASP version*/
  19073. æC 
  19074.  
  19075. æKY aspBufTooSmall
  19076. æFc Errors.h
  19077. æT #define
  19078. æD #define aspBufTooSmall -1067 /*Buffer too small*/
  19079. æC 
  19080.  
  19081. æKY aspNoMoreSess
  19082. æFc Errors.h
  19083. æT #define
  19084. æD #define aspNoMoreSess -1068 /*No more sessions on server*/
  19085. æC 
  19086.  
  19087. æKY aspNoServers
  19088. æFc Errors.h
  19089. æT #define
  19090. æD #define aspNoServers -1069 /*No servers at that address*/
  19091. æC 
  19092.  
  19093. æKY aspParamErr
  19094. æFc Errors.h
  19095. æT #define
  19096. æD #define aspParamErr -1070 /*Parameter error*/
  19097. æC 
  19098.  
  19099. æKY aspServerBusy
  19100. æFc Errors.h
  19101. æT #define
  19102. æD #define aspServerBusy -1071 /*Server cannot open another session*/
  19103. æC 
  19104.  
  19105. æKY aspSessClosed
  19106. æFc Errors.h
  19107. æT #define
  19108. æD #define aspSessClosed -1072 /*Session closed*/
  19109. æC 
  19110.  
  19111. æKY aspSizeErr
  19112. æFc Errors.h
  19113. æT #define
  19114. æD #define aspSizeErr -1073 /*Command block too big*/
  19115. æC 
  19116.  
  19117. æKY aspTooMany
  19118. æFc Errors.h
  19119. æT #define
  19120. æD #define aspTooMany -1074 /*Too many clients (server error)*/
  19121. æC 
  19122.  
  19123. æKY aspNoAck
  19124. æFc Errors.h
  19125. æT #define
  19126. æD #define aspNoAck -1075 /*No ack on attention request (server err)*/
  19127. æC 
  19128.  
  19129. æKY reqFailed
  19130. æFc Errors.h
  19131. æT #define
  19132. æD #define reqFailed -1096
  19133. æC 
  19134.  
  19135. æKY tooManyReqs
  19136. æFc Errors.h
  19137. æT #define
  19138. æD #define tooManyReqs -1097
  19139. æC 
  19140.  
  19141. æKY tooManySkts
  19142. æFc Errors.h
  19143. æT #define
  19144. æD #define tooManySkts -1098
  19145. æC 
  19146.  
  19147. æKY badATPSkt
  19148. æFc Errors.h
  19149. æT #define
  19150. æD #define badATPSkt -1099
  19151. æC 
  19152.  
  19153. æKY badBuffNum
  19154. æFc Errors.h
  19155. æT #define
  19156. æD #define badBuffNum -1100
  19157. æC 
  19158.  
  19159. æKY noRelErr
  19160. æFc Errors.h
  19161. æT #define
  19162. æD #define noRelErr -1101
  19163. æC 
  19164.  
  19165. æKY cbNotFound
  19166. æFc Errors.h
  19167. æT #define
  19168. æD #define cbNotFound -1102
  19169. æC 
  19170.  
  19171. æKY noSendResp
  19172. æFc Errors.h
  19173. æT #define
  19174. æD #define noSendResp -1103
  19175. æC 
  19176.  
  19177. æKY noDataArea
  19178. æFc Errors.h
  19179. æT #define
  19180. æD #define noDataArea -1104
  19181. æC 
  19182.  
  19183. æKY reqAborted
  19184. æFc Errors.h
  19185. æT #define
  19186. æD #define reqAborted -1105
  19187. æC 
  19188.  
  19189. æKY buf2SmallErr
  19190. æFc Errors.h
  19191. æT #define
  19192. æD #define buf2SmallErr -3101
  19193. æC 
  19194.  
  19195. æKY noMPPErr
  19196. æFc Errors.h
  19197. æT #define
  19198. æD #define noMPPErr -3102
  19199. æC 
  19200.  
  19201. æKY ckSumErr
  19202. æFc Errors.h
  19203. æT #define
  19204. æD #define ckSumErr -3103
  19205. æC 
  19206.  
  19207. æKY extractErr
  19208. æFc Errors.h
  19209. æT #define
  19210. æD #define extractErr -3104
  19211. æC 
  19212.  
  19213. æKY readQErr
  19214. æFc Errors.h
  19215. æT #define
  19216. æD #define readQErr -3105
  19217. æC 
  19218.  
  19219. æKY atpLenErr
  19220. æFc Errors.h
  19221. æT #define
  19222. æD #define atpLenErr -3106
  19223. æC 
  19224.  
  19225. æKY atpBadRsp
  19226. æFc Errors.h
  19227. æT #define
  19228. æD #define atpBadRsp -3107
  19229. æC 
  19230.  
  19231. æKY recNotFnd
  19232. æFc Errors.h
  19233. æT #define
  19234. æD #define recNotFnd -3108
  19235. æC 
  19236.  
  19237. æKY sktClosedErr
  19238. æFc Errors.h
  19239. æT #define
  19240. æD #define sktClosedErr -3109
  19241. æC 
  19242.  
  19243. æKY afpAccessDenied
  19244. æFc Errors.h
  19245. æT #define
  19246. æD #define afpAccessDenied -5000
  19247. æC 
  19248.  
  19249. æKY afpAuthContinue
  19250. æFc Errors.h
  19251. æT #define
  19252. æD #define afpAuthContinue -5001
  19253. æC 
  19254.  
  19255. æKY afpBadUAM
  19256. æFc Errors.h
  19257. æT #define
  19258. æD #define afpBadUAM -5002
  19259. æC 
  19260.  
  19261. æKY afpBadVersNum
  19262. æFc Errors.h
  19263. æT #define
  19264. æD #define afpBadVersNum -5003
  19265. æC 
  19266.  
  19267. æKY afpBitmapErr
  19268. æFc Errors.h
  19269. æT #define
  19270. æD #define afpBitmapErr -5004
  19271. æC 
  19272.  
  19273. æKY afpCantMove
  19274. æFc Errors.h
  19275. æT #define
  19276. æD #define afpCantMove -5005
  19277. æC 
  19278.  
  19279. æKY afpDenyConflict
  19280. æFc Errors.h
  19281. æT #define
  19282. æD #define afpDenyConflict -5006
  19283. æC 
  19284.  
  19285. æKY afpDirNotEmpty
  19286. æFc Errors.h
  19287. æT #define
  19288. æD #define afpDirNotEmpty -5007
  19289. æC 
  19290.  
  19291. æKY afpDiskFull
  19292. æFc Errors.h
  19293. æT #define
  19294. æD #define afpDiskFull -5008
  19295. æC 
  19296.  
  19297. æKY afpEofError
  19298. æFc Errors.h
  19299. æT #define
  19300. æD #define afpEofError -5009
  19301. æC 
  19302.  
  19303. æKY afpFileBusy
  19304. æFc Errors.h
  19305. æT #define
  19306. æD #define afpFileBusy -5010
  19307. æC 
  19308.  
  19309. æKY afpFlatVol
  19310. æFc Errors.h
  19311. æT #define
  19312. æD #define afpFlatVol -5011
  19313. æC 
  19314.  
  19315. æKY afpItemNotFound
  19316. æFc Errors.h
  19317. æT #define
  19318. æD #define afpItemNotFound -5012
  19319. æC 
  19320.  
  19321. æKY memROZWarn
  19322. æFc Errors.h
  19323. æT #define
  19324. æD #define memROZWarn -99 /*soft error in ROZ*/
  19325. æC 
  19326.  
  19327. æKY afpLockErr
  19328. æFc Errors.h
  19329. æT #define
  19330. æD #define afpLockErr -5013
  19331. æC 
  19332.  
  19333. æKY afpMiscErr
  19334. æFc Errors.h
  19335. æT #define
  19336. æD #define afpMiscErr -5014
  19337. æC 
  19338.  
  19339. æKY afpNoMoreLocks
  19340. æFc Errors.h
  19341. æT #define
  19342. æD #define afpNoMoreLocks -5015
  19343. æC 
  19344.  
  19345. æKY afpNoServer
  19346. æFc Errors.h
  19347. æT #define
  19348. æD #define afpNoServer -5016
  19349. æC 
  19350.  
  19351. æKY afpObjectExists
  19352. æFc Errors.h
  19353. æT #define
  19354. æD #define afpObjectExists -5017
  19355. æC 
  19356.  
  19357. æKY afpObjectNotFound
  19358. æFc Errors.h
  19359. æT #define
  19360. æD #define afpObjectNotFound -5018
  19361. æC 
  19362.  
  19363. æKY afpParmErr
  19364. æFc Errors.h
  19365. æT #define
  19366. æD #define afpParmErr -5019
  19367. æC 
  19368.  
  19369. æKY afpRangeNotLocked
  19370. æFc Errors.h
  19371. æT #define
  19372. æD #define afpRangeNotLocked -5020
  19373. æC 
  19374.  
  19375. æKY afpRangeOverlap
  19376. æFc Errors.h
  19377. æT #define
  19378. æD #define afpRangeOverlap -5021
  19379. æC 
  19380.  
  19381. æKY afpSessClosed
  19382. æFc Errors.h
  19383. æT #define
  19384. æD #define afpSessClosed -5022
  19385. æC 
  19386.  
  19387. æKY afpUserNotAuth
  19388. æFc Errors.h
  19389. æT #define
  19390. æD #define afpUserNotAuth -5023
  19391. æC 
  19392.  
  19393. æKY afpCallNotSupported
  19394. æFc Errors.h
  19395. æT #define
  19396. æD #define afpCallNotSupported -5024
  19397. æC 
  19398.  
  19399. æKY afpObjectTypeErr
  19400. æFc Errors.h
  19401. æT #define
  19402. æD #define afpObjectTypeErr -5025
  19403. æC 
  19404.  
  19405. æKY afpTooManyFilesOpen
  19406. æFc Errors.h
  19407. æT #define
  19408. æD #define afpTooManyFilesOpen -5026
  19409. æC 
  19410.  
  19411. æKY afpServerGoingDown
  19412. æFc Errors.h
  19413. æT #define
  19414. æD #define afpServerGoingDown -5027
  19415. æC 
  19416.  
  19417. æKY afpCantRename
  19418. æFc Errors.h
  19419. æT #define
  19420. æD #define afpCantRename -5028
  19421. æC 
  19422.  
  19423. æKY afpDirNotFound
  19424. æFc Errors.h
  19425. æT #define
  19426. æD #define afpDirNotFound -5029
  19427. æC 
  19428.  
  19429. æKY afpIconTypeError
  19430. æFc Errors.h
  19431. æT #define
  19432. æD #define afpIconTypeError -5030
  19433. æC 
  19434.  
  19435. æKY afpVolLocked
  19436. æFc Errors.h
  19437. æT #define
  19438. æD #define afpVolLocked -5031 /*Volume is Read-Only*/
  19439. æC 
  19440.  
  19441. æKY afpObjectLocked
  19442. æFc Errors.h
  19443. æT #define
  19444. æD #define afpObjectLocked -5032 /*Object is M/R/D/W inhibited*/
  19445. æC 
  19446.  
  19447. æKY envNotPresent
  19448. æFc Errors.h
  19449. æT #define
  19450. æD #define envNotPresent -5500 /*returned by glue.*/
  19451. æC 
  19452.  
  19453. æKY envBadVers
  19454. æFc Errors.h
  19455. æT #define
  19456. æD #define envBadVers -5501 /*Version non-positive*/
  19457. æC 
  19458.  
  19459. æKY envVersTooBig
  19460. æFc Errors.h
  19461. æT #define
  19462. æD #define envVersTooBig -5502 /*Version bigger than call can handle*/
  19463. æC 
  19464.  
  19465. æKY evtNotEnb
  19466. æFc Errors.h
  19467. æT #define
  19468. æD #define evtNotEnb 1 /*event not enabled at PostEvent*/
  19469. æC 
  19470.  
  19471. æKY dsSysErr
  19472. æFc Errors.h
  19473. æT #define
  19474. æD #define dsSysErr 32767 /*general system error*/
  19475. æC 
  19476.  
  19477. æKY dsBusError
  19478. æFc Errors.h
  19479. æT #define
  19480. æD #define dsBusError 1 /*bus error */
  19481. æC 
  19482.  
  19483. æKY dsAddressErr
  19484. æFc Errors.h
  19485. æT #define
  19486. æD #define dsAddressErr 2 /*address error*/
  19487. æC 
  19488.  
  19489. æKY dsIllInstErr
  19490. æFc Errors.h
  19491. æT #define
  19492. æD #define dsIllInstErr 3 /*illegal instruction error*/
  19493. æC 
  19494.  
  19495. æKY dsZeroDivErr
  19496. æFc Errors.h
  19497. æT #define
  19498. æD #define dsZeroDivErr 4 /*zero divide error*/
  19499. æC 
  19500.  
  19501. æKY dsChkErr
  19502. æFc Errors.h
  19503. æT #define
  19504. æD #define dsChkErr 5 /*check trap error*/
  19505. æC 
  19506.  
  19507. æKY dsOvflowErr
  19508. æFc Errors.h
  19509. æT #define
  19510. æD #define dsOvflowErr 6 /*overflow trap error*/
  19511. æC 
  19512.  
  19513. æKY dsPrivErr
  19514. æFc Errors.h
  19515. æT #define
  19516. æD #define dsPrivErr 7 /*privilege violation error*/
  19517. æC 
  19518.  
  19519. æKY dsTraceErr
  19520. æFc Errors.h
  19521. æT #define
  19522. æD #define dsTraceErr 8 /*trace mode error*/
  19523. æC 
  19524.  
  19525. æKY dsLineAErr
  19526. æFc Errors.h
  19527. æT #define
  19528. æD #define dsLineAErr 9 /*line 1010 trap error*/
  19529. æC 
  19530.  
  19531. æKY dsLineFErr
  19532. æFc Errors.h
  19533. æT #define
  19534. æD #define dsLineFErr 10 /*line 1111 trap error*/
  19535. æC 
  19536.  
  19537. æKY dsMiscErr
  19538. æFc Errors.h
  19539. æT #define
  19540. æD #define dsMiscErr 11 /*miscellaneous hardware exception error*/
  19541. æC 
  19542.  
  19543. æKY dsCoreErr
  19544. æFc Errors.h
  19545. æT #define
  19546. æD #define dsCoreErr 12 /*unimplemented core routine error*/
  19547. æC 
  19548.  
  19549. æKY dsIrqErr
  19550. æFc Errors.h
  19551. æT #define
  19552. æD #define dsIrqErr 13 /*uninstalled interrupt error*/
  19553. æC 
  19554.  
  19555. æKY dsIOCoreErr
  19556. æFc Errors.h
  19557. æT #define
  19558. æD #define dsIOCoreErr 14 /*IO Core Error*/
  19559. æC 
  19560.  
  19561. æKY dsLoadErr
  19562. æFc Errors.h
  19563. æT #define
  19564. æD #define dsLoadErr 15 /*Segment Loader Error*/
  19565. æC 
  19566.  
  19567. æKY dsFPErr
  19568. æFc Errors.h
  19569. æT #define
  19570. æD #define dsFPErr 16 /*Floating point error*/
  19571. æC 
  19572.  
  19573. æKY dsNoPackErr
  19574. æFc Errors.h
  19575. æT #define
  19576. æD #define dsNoPackErr 17 /*package 0 not present*/
  19577. æC 
  19578.  
  19579. æKY dsNoPk1
  19580. æFc Errors.h
  19581. æT #define
  19582. æD #define dsNoPk1 18 /*package 1 not present*/
  19583. æC 
  19584.  
  19585. æKY dsNoPk2
  19586. æFc Errors.h
  19587. æT #define
  19588. æD #define dsNoPk2 19 /*package 2 not present*/
  19589. æC 
  19590.  
  19591. æKY dsNoPk3
  19592. æFc Errors.h
  19593. æT #define
  19594. æD #define dsNoPk3 20 /*package 3 not present*/
  19595. æC 
  19596.  
  19597. æKY dsNoPk4
  19598. æFc Errors.h
  19599. æT #define
  19600. æD #define dsNoPk4 21 /*package 4 not present*/
  19601. æC 
  19602.  
  19603. æKY dsNoPk5
  19604. æFc Errors.h
  19605. æT #define
  19606. æD #define dsNoPk5 22 /*package 5 not present*/
  19607. æC 
  19608.  
  19609. æKY dsNoPk6
  19610. æFc Errors.h
  19611. æT #define
  19612. æD #define dsNoPk6 23 /*package 6 not present*/
  19613. æC 
  19614.  
  19615. æKY dsNoPk7
  19616. æFc Errors.h
  19617. æT #define
  19618. æD #define dsNoPk7 24 /*package 7 not present*/
  19619. æC 
  19620.  
  19621. æKY dsMemFullErr
  19622. æFc Errors.h
  19623. æT #define
  19624. æD #define dsMemFullErr 25 /*out of memory!*/
  19625. æC 
  19626.  
  19627. æKY dsBadLaunch
  19628. æFc Errors.h
  19629. æT #define
  19630. æD #define dsBadLaunch 26 /*can't launch file*/
  19631. æC 
  19632.  
  19633. æKY dsFSErr
  19634. æFc Errors.h
  19635. æT #define
  19636. æD #define dsFSErr 27 /*file system map has been trashed*/
  19637. æC 
  19638.  
  19639. æKY dsStknHeap
  19640. æFc Errors.h
  19641. æT #define
  19642. æD #define dsStknHeap 28 /*stack has moved into application heap*/
  19643. æC 
  19644.  
  19645. æKY dsReinsert
  19646. æFc Errors.h
  19647. æT #define
  19648. æD #define dsReinsert 30 /*request user to reinsert off-line volume*/
  19649. æC 
  19650.  
  19651. æKY dsNotThe1
  19652. æFc Errors.h
  19653. æT #define
  19654. æD #define dsNotThe1 31 /*not the disk I wanted*/
  19655. æC 
  19656.  
  19657. æKY negZcbFreeErr
  19658. æFc Errors.h
  19659. æT #define
  19660. æD #define negZcbFreeErr 33 /*ZcbFree has gone negative*/
  19661. æC 
  19662.  
  19663. æKY dsGreeting
  19664. æFc Errors.h
  19665. æT #define
  19666. æD #define dsGreeting 40 /*welcome to Macintosh greeting*/
  19667. æC 
  19668.  
  19669. æKY dsFinderErr
  19670. æFc Errors.h
  19671. æT #define
  19672. æD #define dsFinderErr 41 /*can't load the Finder error*/
  19673. æC 
  19674.  
  19675. æKY shutDownAlert
  19676. æFc Errors.h
  19677. æT #define
  19678. æD #define shutDownAlert 42 /*handled like a shutdown error*/
  19679. æC 
  19680.  
  19681. æKY menuPrgErr
  19682. æFc Errors.h
  19683. æT #define
  19684. æD #define menuPrgErr 84 /*happens when a menu is purged*/
  19685. æC 
  19686.  
  19687. æKY swOverrunErr
  19688. æFc Errors.h
  19689. æT #define
  19690. æD #define swOverrunErr 1 /*serial driver error masks*/
  19691. æC 
  19692.  
  19693. æKY parityErr
  19694. æFc Errors.h
  19695. æT #define
  19696. æD #define parityErr 16 /*serial driver error masks*/
  19697. æC 
  19698.  
  19699. æKY hwOverrunErr
  19700. æFc Errors.h
  19701. æT #define
  19702. æD #define hwOverrunErr 32 /*serial driver error masks*/
  19703. æC 
  19704.  
  19705. æKY framingErr
  19706. æFc Errors.h
  19707. æT #define
  19708. æD #define framingErr 64 /*serial driver error masks*/
  19709. æC 
  19710.  
  19711. æKY cMatchErr
  19712. æFc Errors.h
  19713. æT #define
  19714. æD #define cMatchErr -150 /*Color2Index failed to find an index*/
  19715. æC 
  19716.  
  19717. æKY cTempMemErr
  19718. æFc Errors.h
  19719. æT #define
  19720. æD #define cTempMemErr -151 /*failed to allocate memory for temporary structures*/
  19721. æC 
  19722.  
  19723. æKY cNoMemErr
  19724. æFc Errors.h
  19725. æT #define
  19726. æD #define cNoMemErr -152 /*failed to allocate memory for structure*/
  19727. æC 
  19728.  
  19729. æKY cRangeErr
  19730. æFc Errors.h
  19731. æT #define
  19732. æD #define cRangeErr -153 /*range error on colorTable request*/
  19733. æC 
  19734.  
  19735. æKY cProtectErr
  19736. æFc Errors.h
  19737. æT #define
  19738. æD #define cProtectErr -154 /*colorTable entry protection violation*/
  19739. æC 
  19740.  
  19741. æKY cDevErr
  19742. æFc Errors.h
  19743. æT #define
  19744. æD #define cDevErr -155 /*invalid type of graphics device*/
  19745. æC 
  19746.  
  19747. æKY cResErr
  19748. æFc Errors.h
  19749. æT #define
  19750. æD #define cResErr -156 /*invalid resolution for MakeITable*/
  19751. æC 
  19752.  
  19753. æKY unitTblFullErr
  19754. æFc Errors.h
  19755. æT #define
  19756. æD #define unitTblFullErr -29 /*unit table has no more entries*/
  19757. æC 
  19758.  
  19759. æKY dceExtErr
  19760. æFc Errors.h
  19761. æT #define
  19762. æD #define dceExtErr -30 /*dce extension error*/
  19763. æC 
  19764.  
  19765. æKY dsBadSlotInt
  19766. æFc Errors.h
  19767. æT #define
  19768. æD #define dsBadSlotInt 51 /*unserviceable slot interrupt*/
  19769. æC 
  19770.  
  19771. æKY dsBadSANEopcode
  19772. æFc Errors.h
  19773. æT #define
  19774. æD #define dsBadSANEopcode 81 /*bad opcode given to SANE Pack4*/
  19775. æC 
  19776.  
  19777. æKY dsNoPatch
  19778. æFc Errors.h
  19779. æT #define
  19780. æD #define dsNoPatch 98 /*Can't patch for particular Model Mac*/
  19781. æC 
  19782.  
  19783. æKY dsBadPatch
  19784. æFc Errors.h
  19785. æT #define
  19786. æD #define dsBadPatch 99 /*Can't load patch resource*/
  19787. æC 
  19788.  
  19789. æKY updPixMemErr
  19790. æFc Errors.h
  19791. æT #define
  19792. æD #define updPixMemErr -125 /*insufficient memory to update a pixmap*/
  19793. æC /*insuffiFc Errors.h
  19794. CIent memory to update a pixmap*/
  19795.  
  19796. æKY mBarNFnd
  19797. æFc Errors.h
  19798. æT #define
  19799. æD #define mBarNFnd -126 /*system error code for MBDF not found*/
  19800. æC 
  19801.  
  19802. æKY hMenuFindErr
  19803. æFc Errors.h
  19804. æT #define
  19805. æD #define hMenuFindErr -127 /*could not find HMenu's parent in MenuKey*/
  19806. æC 
  19807.  
  19808. æKY noHardware
  19809. æFc Errors.h
  19810. æT #define
  19811. æD #define noHardware -200 /*Sound Manager Error Returns*/
  19812. æC 
  19813.  
  19814. æKY notEnoughHardware
  19815. æFc Errors.h
  19816. æT #define
  19817. æD #define notEnoughHardware -201 /*Sound Manager Error Returns*/
  19818. æC 
  19819.  
  19820. æKY queueFull
  19821. æFc Errors.h
  19822. æT #define
  19823. æD #define queueFull -203 /*Sound Manager Error Returns*/
  19824. æC 
  19825.  
  19826. æKY resProblem
  19827. æFc Errors.h
  19828. æT #define
  19829. æD #define resProblem -204 /*Sound Manager Error Returns*/
  19830. æC 
  19831.  
  19832. æKY badChannel
  19833. æFc Errors.h
  19834. æT #define
  19835. æD #define badChannel -205 /*Sound Manager Error Returns*/
  19836. æC 
  19837.  
  19838. æKY badFormat
  19839. æFc Errors.h
  19840. æT #define
  19841. æD #define badFormat -206 /*Sound Manager Error Returns*/
  19842. æC 
  19843.  
  19844. æKY smSDMInitErr
  19845. æFc Errors.h
  19846. æT #define
  19847. æD #define smSDMInitErr -290 /*Error; SDM could not be initialized.*/
  19848. æC 
  19849.  
  19850. æKY smSRTInitErr
  19851. æFc Errors.h
  19852. æT #define
  19853. æD #define smSRTInitErr -291 /*Error; Slot Resource Table could not be initialized.*/
  19854. æC 
  19855.  
  19856. æKY smPRAMInitErr
  19857. æFc Errors.h
  19858. æT #define
  19859. æD #define smPRAMInitErr -292 /*Error; Slot Resource Table could not be initialized.*/
  19860. æC 
  19861.  
  19862. æKY smPriInitErr
  19863. æFc Errors.h
  19864. æT #define
  19865. æD #define smPriInitErr -293 /*Error; Cards could not be initialized.*/
  19866. æC 
  19867.  
  19868. æKY nmTypErr
  19869. æFc Errors.h
  19870. æT #define
  19871. æD #define nmTypErr -299
  19872. æC 
  19873.  
  19874. æKY smEmptySlot
  19875. æFc Errors.h
  19876. æT #define
  19877. æD #define smEmptySlot -300 /*No card in slot*/
  19878. æC 
  19879.  
  19880. æKY smCRCFail
  19881. æFc Errors.h
  19882. æT #define
  19883. æD #define smCRCFail -301 /*CRC check failed for declaration data*/
  19884. æC 
  19885.  
  19886. æKY smFormatErr
  19887. æFc Errors.h
  19888. æT #define
  19889. æD #define smFormatErr -302 /*FHeader Format is not Apple's*/
  19890. æC 
  19891.  
  19892. æKY smRevisionErr
  19893. æFc Errors.h
  19894. æT #define
  19895. æD #define smRevisionErr -303 /*Wrong revison level*/
  19896. æC 
  19897.  
  19898. æKY smNoDir
  19899. æFc Errors.h
  19900. æT #define
  19901. æD #define smNoDir -304 /*Directory offset is Nil */
  19902. æC 
  19903.  
  19904. æKY smLWTstBad
  19905. æFc Errors.h
  19906. æT #define
  19907. æD #define smLWTstBad -305 /*Long Word test field <> $5A932BC7.*/
  19908. æC 
  19909.  
  19910. æKY smNosInfoArray
  19911. æFc Errors.h
  19912. æT #define
  19913. æD #define smNosInfoArray -306 /*No sInfoArray. Memory Mgr error.*/
  19914. æC 
  19915.  
  19916. æKY smResrvErr
  19917. æFc Errors.h
  19918. æT #define
  19919. æD #define smResrvErr -307 /*Fatal reserved error. Resreved field <> 0.*/
  19920. æC 
  19921.  
  19922. æKY smUnExBusErr
  19923. æFc Errors.h
  19924. æT #define
  19925. æD #define smUnExBusErr -308 /*Unexpected BusError*/
  19926. æC 
  19927.  
  19928. æKY smBLFieldBad
  19929. æFc Errors.h
  19930. æT #define
  19931. æD #define smBLFieldBad -309 /*ByteLanes field was bad.*/
  19932. æC 
  19933.  
  19934. æKY smFHBlockRdErr
  19935. æFc Errors.h
  19936. æT #define
  19937. æD #define smFHBlockRdErr -310 /*Error occured during _sGetFHeader.*/
  19938. æC 
  19939.  
  19940. æKY smDisposePErr
  19941. æFc Errors.h
  19942. æT #define
  19943. æD #define smDisposePErr -312 /*_DisposePointer error*/
  19944. æC 
  19945.  
  19946. æKY smNoBoardsRsrc
  19947. æFc Errors.h
  19948. æT #define
  19949. æD #define smNoBoardsRsrc -313 /*No Board sResource.*/
  19950. æC 
  19951.  
  19952. æKY smGetPRErr
  19953. æFc Errors.h
  19954. æT #define
  19955. æD #define smGetPRErr -314 /*Error occured during _sGetPRAMRec (See SIMStatus).*/
  19956. æC 
  19957.  
  19958. æKY smNoBoardId
  19959. æFc Errors.h
  19960. æT #define
  19961. æD #define smNoBoardId -315 /*No Board Id.*/
  19962. æC 
  19963.  
  19964. æKY smInitStatVErr
  19965. æFc Errors.h
  19966. æT #define
  19967. æD #define smInitStatVErr -316 /*The InitStatusV field was negative after primary or secondary init.*/
  19968. æC 
  19969.  
  19970. æKY smInitTblErr
  19971. æFc Errors.h
  19972. æT #define
  19973. æD #define smInitTblErr -317 /*An error occured while trying to initialize the Slot Resource Table.*/
  19974. æC 
  19975.  
  19976. æKY smNoJmpTbl
  19977. æFc Errors.h
  19978. æT #define
  19979. æD #define smNoJmpTbl -318 /*SDM jump table could not be created.*/
  19980. æC 
  19981.  
  19982. æKY smBadBoardId
  19983. æFc Errors.h
  19984. æT #define
  19985. æD #define smBadBoardId -319 /*BoardId was wrong; re-init the PRAM record.*/
  19986. æC 
  19987.  
  19988. æKY smBusErrTO
  19989. æFc Errors.h
  19990. æT #define
  19991. æD #define smBusErrTO -320 /*BusError time out.*/
  19992. æC 
  19993.  
  19994. æKY smBadRefId
  19995. æFc Errors.h
  19996. æT #define
  19997. æD #define smBadRefId -330 /*Reference Id not found in List*/
  19998. æC 
  19999.  
  20000. æKY smBadsList
  20001. æFc Errors.h
  20002. æT #define
  20003. æD #define smBadsList -331 /*Bad sList: Id1 < Id2 < Id3 ...format is not followed.*/
  20004. æC 
  20005.  
  20006. æKY smReservedErr
  20007. æFc Errors.h
  20008. æT #define
  20009. æD #define smReservedErr -332 /*Reserved field not zero*/
  20010. æC 
  20011.  
  20012. æKY smCodeRevErr
  20013. æFc Errors.h
  20014. æT #define
  20015. æD #define smCodeRevErr -333 /*Code revision is wrong*/
  20016. æC 
  20017.  
  20018. æKY smCPUErr
  20019. æFc Errors.h
  20020. æT #define
  20021. æD #define smCPUErr -334 /*Code revision is wrong*/
  20022. æC 
  20023.  
  20024. æKY smsPointerNil
  20025. æFc Errors.h
  20026. æT #define
  20027. æD #define smsPointerNil -335 /*LPointer is nil From sOffsetData. If this error occurs; check sInfo rec for more information.*/
  20028. æC 
  20029.  
  20030. æKY smNilsBlockErr
  20031. æFc Errors.h
  20032. æT #define
  20033. æD #define smNilsBlockErr -336 /*Nil sBlock error (Dont allocate and try to use a nil sBlock)*/
  20034. æC 
  20035.  
  20036. æKY smSlotOOBErr
  20037. æFc Errors.h
  20038. æT #define
  20039. æD #define smSlotOOBErr -337 /*Slot out of bounds error*/
  20040. æC 
  20041.  
  20042. æKY smSelOOBErr
  20043. æFc Errors.h
  20044. æT #define
  20045. æD #define smSelOOBErr -338 /*Selector out of bounds error*/
  20046. æC 
  20047.  
  20048. æKY smNewPErr
  20049. æFc Errors.h
  20050. æT #define
  20051. æD #define smNewPErr -339 /*_NewPtr error*/
  20052. æC 
  20053.  
  20054. æKY smBlkMoveErr
  20055. æFc Errors.h
  20056. æT #define
  20057. æD #define smBlkMoveErr -340 /*_BlockMove error*/
  20058. æC 
  20059.  
  20060. æKY smCkStatusErr
  20061. æFc Errors.h
  20062. æT #define
  20063. æD #define smCkStatusErr -341 /*Status of slot = fail.*/
  20064. æC 
  20065.  
  20066. æKY smGetDrvrNamErr
  20067. æFc Errors.h
  20068. æT #define
  20069. æD #define smGetDrvrNamErr -342 /*Error occured during _sGetDrvrName.*/
  20070. æC 
  20071.  
  20072. æKY smDisDrvrNamErr
  20073. æFc Errors.h
  20074. æT #define
  20075. æD #define smDisDrvrNamErr -343 /*Error occured during _sDisDrvrName.*/
  20076. æC 
  20077.  
  20078. æKY smNoMoresRsrcs
  20079. æFc Errors.h
  20080. æT #define
  20081. æD #define smNoMoresRsrcs -344 /*No more sResources*/
  20082. æC 
  20083.  
  20084. æKY smsGetDrvrErr
  20085. æFc Errors.h
  20086. æT #define
  20087. æD #define smsGetDrvrErr -345 /*Error occurred during _sGetDriver.*/
  20088. æC 
  20089.  
  20090. æKY smBadsPtrErr
  20091. æFc Errors.h
  20092. æT #define
  20093. æD #define smBadsPtrErr -346 /*Bad pointer was passed to sCalcsPointer*/
  20094. æC 
  20095.  
  20096. æKY smByteLanesErr
  20097. æFc Errors.h
  20098. æT #define
  20099. æD #define smByteLanesErr -347 /*NumByteLanes was determined to be zero.*/
  20100. æC 
  20101.  
  20102. æKY smOffsetErr
  20103. æFc Errors.h
  20104. æT #define
  20105. æD #define smOffsetErr -348 /*Offset was too big (temporary error*/
  20106. æC 
  20107.  
  20108. æKY smNoGoodOpens
  20109. æFc Errors.h
  20110. æT #define
  20111. æD #define smNoGoodOpens -349 /*No opens were successfull in the loop.*/
  20112. æC 
  20113.  
  20114. æKY smSRTOvrFlErr
  20115. æFc Errors.h
  20116. æT #define
  20117. æD #define smSRTOvrFlErr -350 /*SRT over flow.*/
  20118. æC 
  20119.  
  20120. æKY smRecNotFnd
  20121. æFc Errors.h
  20122. æT #define
  20123. æD #define smRecNotFnd -351 /*Record not found in the SRT.*/
  20124. æC 
  20125.  
  20126. æKY slotNumErr
  20127. æFc Errors.h
  20128. æT #define
  20129. æD #define slotNumErr -360 /*invalid slot # error*/
  20130. æC 
  20131.  
  20132. æKY gcrOnMFMErr
  20133. æFc Errors.h
  20134. æT #define
  20135. æD #define gcrOnMFMErr -400 /*gcr format on high density media error*/
  20136. æC 
  20137.  
  20138. æKY rgnTooBigErr
  20139. æFc Errors.h
  20140. æT #define
  20141. æD #define rgnTooBigErr -500
  20142. æC 
  20143.  
  20144. æKY teScrapSizeErr
  20145. æFc Errors.h
  20146. æT #define
  20147. æD #define teScrapSizeErr -501 /*scrap item too big for text edit record*/
  20148. æC 
  20149.  
  20150. æKY hwParamErr
  20151. æFc Errors.h
  20152. æT #define
  20153. æD #define hwParamErr -502 /*bad selector for _HWPriv*/
  20154. æC 
  20155.  
  20156. æKY svTempDisable
  20157. æFc Errors.h
  20158. æT #define
  20159. æD 
  20160. /*  The following errors are for primary or secondary init code.  The errors are logged in the
  20161. vendor status field of the sInfo record.  Normally the vendor error is not Apple's concern,
  20162. but a special error is needed to patch secondary inits.
  20163.  
  20164.  */
  20165.  
  20166. #define svTempDisable -32768 /*Temporarily disable card but run primary init.*/
  20167. æC 
  20168.  
  20169. æKY svDisabled
  20170. æFc Errors.h
  20171. æT #define
  20172. æD #define svDisabled -32640 /*Reserve range -32640 to -32768 for Apple temp disables.*/
  20173. æC 
  20174.  
  20175. æKY siInitSDTblErr
  20176. æFc Errors.h
  20177. æT #define
  20178. æD #define siInitSDTblErr 1 /*slot int dispatch table could not be initialized.*/
  20179. æC 
  20180.  
  20181. æKY siInitVBLQsErr
  20182. æFc Errors.h
  20183. æT #define
  20184. æD #define siInitVBLQsErr 2 /*VBLqueues for all slots could not be initialized.*/
  20185. æC 
  20186.  
  20187. æKY siInitSPTblErr
  20188. æFc Errors.h
  20189. æT #define
  20190. æD #define siInitSPTblErr 3 /*slot priority table could not be initialized.*/
  20191. æC 
  20192.  
  20193. æKY sdmJTInitErr
  20194. æFc Errors.h
  20195. æT #define
  20196. æD #define sdmJTInitErr 10 /*SDM Jump Table could not be initialized.*/
  20197. æC 
  20198.  
  20199. æKY sdmInitErr
  20200. æFc Errors.h
  20201. æT #define
  20202. æD #define sdmInitErr 11 /*SDM could not be initialized.*/
  20203. æC 
  20204.  
  20205. æKY sdmSRTInitErr
  20206. æFc Errors.h
  20207. æT #define
  20208. æD #define sdmSRTInitErr 12 /*Slot Resource Table could not be initialized.*/
  20209. æC 
  20210.  
  20211. æKY sdmPRAMInitErr
  20212. æFc Errors.h
  20213. æT #define
  20214. æD #define sdmPRAMInitErr 13 /*Slot PRAM could not be initialized.*/
  20215. æC 
  20216.  
  20217. æKY sdmPriInitErr
  20218. æFc Errors.h
  20219. æT #define
  20220. æD #define sdmPriInitErr 14 /*Cards could not be initialized.*/
  20221. æC 
  20222.  
  20223. æKY dsMBarNFnd
  20224. æFc Errors.h
  20225. æT #define
  20226. æD #define dsMBarNFnd 85 /*Menu Manager Errors*/
  20227. æC 
  20228.  
  20229. æKY dsHMenuFindErr
  20230. æFc Errors.h
  20231. æT #define
  20232. æD #define dsHMenuFindErr 86 /*Menu Manager Errors*/
  20233. æC 
  20234.  
  20235. æKY MacOSErr
  20236. æFc Errors.h
  20237. æT typedef
  20238. æD extern short MacOSErr;
  20239. æC 
  20240.  
  20241. æKY SysError
  20242. æFc Errors.h
  20243. æT Function
  20244. æD pascal void SysError(short errorCode)
  20245.     = {0x301F,0xA9C9}; 
  20246. æDT SysError((short) errorCode);
  20247. æMM
  20248. æRI II-362, V-572
  20249. æC _____________________________________________________________________________________
  20250.  
  20251. Trap macro  _SysError
  20252. On entry    D0:  errorCode (word)
  20253. On exit     All registers changed
  20254. _____________________________________________________________________________________
  20255. SysError generates a system error with the ID specified by the errorCode 
  20256. parameter.
  20257.  
  20258. It takes the following precise steps:
  20259. 1.  It saves all registers and the stack pointer.
  20260. 2.  It stores the system error ID in a global variable (named DSErrCode).
  20261. 3.  It checks to see whether there's a system error alert table in memory (by 
  20262.     testing whether the global variable DSAlertTab is 0); if there isn't, it draws 
  20263.     the "sad Macintosh" icon.
  20264. 4.  It allocates memory for QuickDraw globals on the stack, initializes 
  20265.     QuickDraw, and initializes a grafPort in which the alert box will be drawn.
  20266. 5.  It checks the system error ID.  If the system error ID is negative, the alert 
  20267.     box isn't redrawn (this is used for system startup alerts, which can display a 
  20268.     sequence of consecutive messages in the same box).  If the system error ID 
  20269.     doesn't correspond to an entry in the system error alert table, the default 
  20270.     alert definition at the start of the table will be used, displaying the message 
  20271.     "Sorry, a system error occurred".
  20272. 6.  It draws an alert box (in the rectangle specified by the global variable 
  20273.     DSAlertRect).
  20274. 7.  If the text definition IDs in the alert definition for this alert aren't 0, it 
  20275.     draws both strings.
  20276. 8.  If the icon definition ID in the alert definition isn't 0, it draws the icon.
  20277. 9.  If the procedure definition ID in the alert definition isn't 0, it invokes the 
  20278.     procedure with the specified ID.
  20279. 10. If the button definition ID in the alert definition is 0, it returns control to 
  20280.     the procedure that called it (this is used during the disk-switch alert to return
  20281.     control to the File Manager after the "Please insert the disk:" message has been 
  20282.     displayed).
  20283. 11. If there's a resume procedure, it increments the button definition ID by 1.
  20284. 12. It draws the buttons.
  20285. 13. It hit-tests the buttons and calls the corresponding procedure code when a 
  20286.     button is pressed.  If there's no procedure code, it returns to the procedure 
  20287.     that called it.
  20288.  
  20289. User Alerts
  20290. _____________
  20291. ID  Explanation
  20292. 1   Bus error:  Invalid memory reference; happens only on a Macintosh XL 
  20293. 2   Address error:  Word or long-word reference made to an odd address
  20294. 3   Illegal instruction:  The MC68000 received an instruction it didn't recognize.
  20295. 4   Zero divide:  Signed Divide (DIVS) or Unsigned Divide (DIVU) instruction 
  20296.                   with a divisor of 0 was executed.
  20297. 5   Check exception:  Check Register Against Bounds (CHK) instruction was executed 
  20298.                       and failed.  Pascal "value out of range" errors are usually 
  20299.                       reported in this way.
  20300. 6   TrapV exception:  Trap On Overflow (TRAPV) instruction was executed and failed.
  20301. 7   Privilege violation:  Macintosh always runs in supervisor mode; perhaps an 
  20302.                           erroneous Return From Execution (RTE) instruction was 
  20303.                           executed.
  20304. 8   Trace exception:  The trace bit in the status register is set.
  20305. 9   Line 1010 exception:  The 1010 trap dispatcher has failed.
  20306. 10  Line 1111 exception:  Unimplemented instruction
  20307. 11  Miscellaneous exception:  All other MC68000 exceptions
  20308. 12  Unimplemented core routine:  An unimplemented trap number was encountered.
  20309. 13  Spurious interrupt:  The interrupt vector table entry for a particular level 
  20310.                          of interrupt is NIL; usually occurs with level 4, 5, 6, or 7 
  20311.                          interrupts.
  20312. 14  I/O system error:  The File Manager is attempting to dequeue an entry from 
  20313.                        an I/O request queue that has a bad queue type field; perhaps 
  20314.                        the queue entry is unlocked.  Or, the dCtlQHead field was NIL 
  20315.                        during a Fetch or Stash call.  Or, a needed device control 
  20316.                        entry has been purged.
  20317. 15  Segment Loader error:  A GetResource call to read a segment into memory failed.
  20318. 16  Floating point error:  The halt bit in the floating-point environment word was 
  20319.                            set.
  20320. 17-24 Can't load package:  A GetResource call to read a package into memory failed.
  20321. 25  Can't allocate requested memory block in the heap
  20322. 26  Segment Loader error:  A GetResource call to read 'CODE' resource 0 into 
  20323.                            memory failed; usually indicates a nonexecutable file.
  20324. 27  File map destroyed:  A logical block number was found that's greater than 
  20325.                          the number of the last logical block on the volume or less 
  20326.                          than the logical block number of the first allocation block 
  20327.                          on the volume.
  20328. 28  Stack overflow error:  The stack has expanded into the heap.
  20329. 30  "Please insert the disk:" File Manager alert
  20330. 41  The file named "Finder" can't be found on the disk.
  20331. 100 Can't mount system startup volume.  The system couldn't read the system resource 
  20332.                                         file into memory.
  20333. 32767 "Sorry, a system error occurred":  Default alert message 
  20334.  
  20335.  
  20336. æKY Events.h
  20337. æKL Button
  20338. EventAvail
  20339. GetCaretTime
  20340. GetDblTime
  20341. GetKeys
  20342. GetMouse
  20343. GetNextEvent
  20344. StillDown
  20345. TickCount
  20346. WaitMouseUp
  20347. WaitNextEvent
  20348.  
  20349. activateEvt
  20350. activeFlag
  20351. activMask
  20352. adbAddrMask
  20353. alphaLock
  20354. app1Evt
  20355. app1Mask
  20356. app2Evt
  20357. app2Mask
  20358. app3Evt
  20359. app3Mask
  20360. app4Evt
  20361. app4Mask
  20362. autoKey
  20363. autoKeyMask
  20364. btnState
  20365. charCodeMask
  20366. childDiedMessage
  20367. cmdKey
  20368. controlKey
  20369. diskEvt
  20370. diskMask
  20371. driverEvt
  20372. driverMask
  20373. EventRecord
  20374. everyEvent
  20375. keyCodeMask
  20376. keyDown
  20377. keyDownMask
  20378. KeyMap
  20379. keyUp
  20380. keyUpMask
  20381. mDownMask
  20382. mouseDown
  20383. mouseMovedMessage
  20384. mouseUp
  20385. mUpMask
  20386. networkEvt
  20387. networkMask
  20388. nullEvent
  20389. optionKey
  20390. osEvt
  20391. osEvtMessageMask
  20392. shiftKey
  20393. suspendResumeMessage
  20394. updateEvt
  20395. updateMask
  20396.  
  20397. æKY nullEvent
  20398. æFc Events.h
  20399. æT #define
  20400. æD #define nullEvent 0
  20401. æC 
  20402. »Event Code
  20403.  
  20404. The what field of an event record contains an event code identifying the type of the
  20405. event. The event codes are available as predefined constants:
  20406.  
  20407. #define nullEvent     0    /*null*/
  20408. #define mouseDown     1    /*mouse-down*/
  20409. #define mouseUp       2    /*mouse-up*/
  20410. #define keyDown       4    /*key-down*/
  20411. #define keyUp         3    /*key-up*/
  20412. #define autoKey       5    /*auto-key*/
  20413. #define updateEvt     6    /*update*/
  20414. #define diskEvt       7    /*disk-inserted*/
  20415. #define activateEvt   8    /*activate*/
  20416. #define networkEvt   10    /*network*/
  20417. #define driverEvt    11    /*device driver*/
  20418. #define app1Evt      12    /*application-defined*/
  20419. #define app2Evt      13    /*application-defined*/
  20420. #define app3Evt      14    /*application-defined*/
  20421. #define app4Evt      15    /*application-defined*/
  20422.  
  20423. æKY mouseDown
  20424. æFc Events.h
  20425. æT #define
  20426. æD #define mouseDown 1
  20427. æC 
  20428.  
  20429. æKY mouseUp
  20430. æFc Events.h
  20431. æT #define
  20432. æD #define mouseUp 2
  20433. æC 
  20434.  
  20435. æKY keyDown
  20436. æFc Events.h
  20437. æT #define
  20438. æD #define keyDown 3
  20439. æC 
  20440.  
  20441. æKY keyUp
  20442. æFc Events.h
  20443. æT #define
  20444. æD #define keyUp 4
  20445. æC 
  20446.  
  20447. æKY autoKey
  20448. æFc Events.h
  20449. æT #define
  20450. æD #define autoKey 5
  20451. æC 
  20452.  
  20453. æKY updateEvt
  20454. æFc Events.h
  20455. æT #define
  20456. æD #define updateEvt 6
  20457. æC 
  20458.  
  20459. æKY diskEvt
  20460. æFc Events.h
  20461. æT #define
  20462. æD #define diskEvt 7
  20463. æC 
  20464.  
  20465. æKY activateEvt
  20466. æFc Events.h
  20467. æT #define
  20468. æD #define activateEvt 8
  20469. æC 
  20470.  
  20471. æKY networkEvt
  20472. æFc Events.h
  20473. æT #define
  20474. æD #define networkEvt 10
  20475. æC 
  20476.  
  20477. æKY driverEvt
  20478. æFc Events.h
  20479. æT #define
  20480. æD #define driverEvt 11
  20481. æC 
  20482.  
  20483. æKY app1Evt
  20484. æFc Events.h
  20485. æT #define
  20486. æD #define app1Evt 12
  20487. æC 
  20488.  
  20489. æKY app2Evt
  20490. æFc Events.h
  20491. æT #define
  20492. æD #define app2Evt 13
  20493. æC 
  20494.  
  20495. æKY app3Evt
  20496. æFc Events.h
  20497. æT #define
  20498. æD #define app3Evt 14
  20499. æC 
  20500.  
  20501. æKY app4Evt
  20502. æFc Events.h
  20503. æT #define
  20504. æD #define app4Evt 15
  20505. æC 
  20506.  
  20507. æKY osEvt
  20508. æFc Events.h
  20509. æT #define
  20510. æD #define osEvt app4Evt
  20511. æC 
  20512.  
  20513. æKY charCodeMask
  20514. æFc Events.h
  20515. æT #define
  20516. æD #define charCodeMask 0x000000FF
  20517. æC 
  20518.  
  20519. æKY keyCodeMask
  20520. æFc Events.h
  20521. æT #define
  20522. æD #define keyCodeMask 0x0000FF00
  20523. æC 
  20524.  
  20525. æKY adbAddrMask
  20526. æFc Events.h
  20527. æT #define
  20528. æD #define adbAddrMask 0x00FF0000
  20529. æC 
  20530.  
  20531. æKY osEvtMessageMask
  20532. æFc Events.h
  20533. æT #define
  20534. æD #define osEvtMessageMask 0xFF000000
  20535. æC 
  20536.  
  20537. æKY mouseMovedMessage
  20538. æFc Events.h
  20539. æT #define
  20540. æD 
  20541. /* OSEvent Messages */
  20542.  
  20543. #define mouseMovedMessage 0xFA
  20544. æC 
  20545.  
  20546. æKY childDiedMessage
  20547. æFc Events.h
  20548. æT #define
  20549. æD #define childDiedMessage 0xFD
  20550. æC 
  20551.  
  20552. æKY suspendResumeMessage
  20553. æFc Events.h
  20554. æT #define
  20555. æD #define suspendResumeMessage 0x01
  20556. æC 
  20557.  
  20558. æKY mDownMask
  20559. æFc Events.h
  20560. æT #define
  20561. æD 
  20562. /* event mask equates */
  20563.  
  20564. #define mDownMask 2
  20565. æC 
  20566. _______________________________________________________________________________
  20567.  
  20568. »EVENT MASKS
  20569. _______________________________________________________________________________
  20570.  
  20571. Some of the Event Manager routines can be restricted to operate on a specific event
  20572. type or group of types; in other words, the specified event types are enabled while
  20573. all others are disabled. For instance, instead of just requesting the next available
  20574. event, you can specifically ask for the next keyboard event.
  20575.  
  20576. You specify which event types a particular Event Manager call applies to by supplying
  20577. an event mask as a parameter. This is an integer in which there’s one bit position
  20578. for each event type, as shown in Figure 8. The bit position representing a given type
  20579. corresponds to the event code for that type—for example, update events (event code 6)
  20580. are specified by bit 6 of the mask. A 1 in bit 6 means that this Event Manager call
  20581. applies to update events; a 0 means that it doesn’t.
  20582.  
  20583. •••Refer to Figure 8.•••
  20584.  
  20585. Figure 8–Event Mask
  20586.  
  20587. Masks for each individual event type are available as predefined constants:
  20588.  
  20589. #define mDownMask    2       /*mouse-down*/
  20590. #define mUpMask      4       /*mouse-up*/
  20591. #define keyDownMask  8       /*key-down*/
  20592. #define keyUpMask    16      /*key-up*/
  20593. #define autoKeyMask  32      /*auto-key*/
  20594. #define updateMask   64      /*update*/
  20595. #define diskMask     128     /*disk-inserted*/
  20596. #define activMask    256     /*activate*/
  20597. #define networkMask  1024    /*network*/
  20598. #define driverMask   2048    /*device driver*/
  20599. #define app1Mask     4096    /*application-defined*/
  20600. #define app2Mask     8192    /*application-defined*/
  20601. #define app3Mask     16384   /*application-defined*/
  20602. #define app4Mask     -32768  /*application-defined*/
  20603.  
  20604. Note:  Null events can’t be disabled; a null event will always be reported
  20605.        when none of the enabled types of events are available.
  20606.  
  20607. The following predefined mask designates all event types:
  20608.  
  20609. CONST    everyEvent    = -1;    {all event types}
  20610.  
  20611. You can form any mask you need by adding or subtracting these mask constants. For
  20612. example, to specify every keyboard event, use
  20613.  
  20614.   keyDownMask + keyUpMask + autoKeyMask
  20615.  
  20616. For every event except an update, use
  20617.  
  20618.   everyEvent - updateMask
  20619.  
  20620. Note:  It’s recommended that you always use the event mask everyEvent unless
  20621.        there’s a specific reason not to.
  20622.  
  20623. There’s also a global system event mask that controls which event types get posted
  20624. into the event queue. Only event types corresponding to bits set in the system event
  20625. mask are posted; all others are ignored. When the system starts up, the system event
  20626. mask is set to post all except key-up event—that is, it’s initialized to
  20627.  
  20628.   everyEvent - keyUpMask
  20629.  
  20630. Note:  Key-up events are meaningless for most applications. Your application
  20631.        will usually want to ignore them; if not, it can set the system event
  20632.        mask with the Operating System Event Manager procedure SetEventMask.
  20633.  
  20634. æKY mUpMask
  20635. æFc Events.h
  20636. æT #define
  20637. æD #define mUpMask 4
  20638. æC 
  20639.  
  20640. æKY keyDownMask
  20641. æFc Events.h
  20642. æT #define
  20643. æD #define keyDownMask 8
  20644. æC 
  20645.  
  20646. æKY keyUpMask
  20647. æFc Events.h
  20648. æT #define
  20649. æD #define keyUpMask 16
  20650. æC 
  20651.  
  20652. æKY autoKeyMask
  20653. æFc Events.h
  20654. æT #define
  20655. æD #define autoKeyMask 32
  20656. æC 
  20657.  
  20658. æKY updateMask
  20659. æFc Events.h
  20660. æT #define
  20661. æD #define updateMask 64
  20662. æC 
  20663.  
  20664. æKY diskMask
  20665. æFc Events.h
  20666. æT #define
  20667. æD #define diskMask 128
  20668. æC 
  20669.  
  20670. æKY activMask
  20671. æFc Events.h
  20672. æT #define
  20673. æD #define activMask 256
  20674. æC 
  20675.  
  20676. æKY networkMask
  20677. æFc Events.h
  20678. æT #define
  20679. æD #define networkMask 1024
  20680. æC 
  20681.  
  20682. æKY driverMask
  20683. æFc Events.h
  20684. æT #define
  20685. æD #define driverMask 2048
  20686. æC 
  20687.  
  20688. æKY app1Mask
  20689. æFc Events.h
  20690. æT #define
  20691. æD #define app1Mask 4096
  20692. æC 
  20693.  
  20694. æKY app2Mask
  20695. æFc Events.h
  20696. æT #define
  20697. æD #define app2Mask 8192
  20698. æC 
  20699.  
  20700. æKY app3Mask
  20701. æFc Events.h
  20702. æT #define
  20703. æD #define app3Mask 16384
  20704. æC 
  20705.  
  20706. æKY app4Mask
  20707. æFc Events.h
  20708. æT #define
  20709. æD #define app4Mask -32768
  20710. æC 
  20711.  
  20712. æKY everyEvent
  20713. æFc Events.h
  20714. æT #define
  20715. æD #define everyEvent -1
  20716. æC 
  20717.  
  20718. æKY activeFlag
  20719. æFc Events.h
  20720. æT #define
  20721. æD 
  20722. /* modifiers */
  20723.  
  20724. #define activeFlag 1 /*bit 0 of modifiers for activate event*/
  20725. æC 
  20726. »Modifier Flags
  20727.  
  20728. As mentioned above, the modifiers field of an event record contains further information
  20729. about activate events and the state of the modifier keys and mouse button at the time
  20730. the event was posted (see Figure 7). You might look at this field to find out, for
  20731. instance, whether the Command key was down when a mouse-down event was posted (which
  20732. in many applications affects the way objects are selected) or when a key-down event
  20733. was posted (which could mean the user is choosing a menu item by typing its keyboard
  20734. equivalent).
  20735.  
  20736. •••Refer to Figure 7.•••
  20737.  
  20738. Figure 7–Modifier Flags
  20739.  
  20740. The following predefined constants are useful as masks for reading the flags in the
  20741. modifiers field:
  20742.  
  20743. #define activeFlag  1     /*set if window being activated*/
  20744. #define btnState    128   /*set if mouse button up*/
  20745. #define cmdKey      256   /*set if Command key down*/
  20746. #define shiftKey    512   /*set if Shift key down*/
  20747. #define alphaLock   1024  /*set if Caps Lock key down*/
  20748. #define optionKey   2048  /*set if Option key down*/
  20749. #define controlKey  4096  /*set if Control key down*/
  20750.  
  20751. The activeFlag bit gives further information about activate events; it’s set if the
  20752. window pointed to by the event message is being activated, or 0 if the window is
  20753. being deactivated. The remaining bits indicate the state of the mouse button and
  20754. modifier keys. Notice that the btnState bit is set if the mouse button is up, whereas
  20755. the bits for the four modifier keys are set if their corresponding keys are down.
  20756.  
  20757. æKY btnState
  20758. æFc Events.h
  20759. æT #define
  20760. æD #define btnState 128 /*Bit 7 of low byte is mouse button state*/
  20761. æC 
  20762.  
  20763. æKY cmdKey
  20764. æFc Events.h
  20765. æT #define
  20766. æD #define cmdKey 256 /*Bit 0*/
  20767. æC 
  20768.  
  20769. æKY shiftKey
  20770. æFc Events.h
  20771. æT #define
  20772. æD #define shiftKey 512 /*Bit 1*/
  20773. æC 
  20774.  
  20775. æKY alphaLock
  20776. æFc Events.h
  20777. æT #define
  20778. æD #define alphaLock 1024 /*Bit 2 */
  20779. æC 
  20780.  
  20781. æKY optionKey
  20782. æFc Events.h
  20783. æT #define
  20784. æD #define optionKey 2048 /*Bit 3 of high byte*/
  20785. æC 
  20786.  
  20787. æKY controlKey
  20788. æFc Events.h
  20789. æT #define
  20790. æD #define controlKey 4096
  20791. æC 
  20792.  
  20793. æKY KeyMap
  20794. æFc Events.h
  20795. æT typedef
  20796. æD typedef long KeyMap[4];
  20797. æC 
  20798.  
  20799. æKY EventRecord
  20800. æFc Events.h
  20801. æT struct
  20802. æD struct EventRecord {
  20803.     short what;
  20804.     long message;
  20805.     long when;
  20806.     Point where;
  20807.     short modifiers;
  20808. };
  20809.  
  20810. typedef struct EventRecord EventRecord;
  20811. æC 
  20812. _______________________________________________________________________________
  20813.  
  20814. »EVENT RECORDS
  20815. _______________________________________________________________________________
  20816.  
  20817. Every event is represented internally by an event record containing all pertinent
  20818. information about that event. The event record includes the following information:
  20819.  
  20820.   •  the type of event
  20821.   •  the time the event was posted (in ticks since system startup)
  20822.   •  the location of the mouse at the time the event was posted (in global
  20823.      coordinates)
  20824.   •  the state of the mouse button and modifier keys at the time the event
  20825.      was posted
  20826.   •  any additional information required for a particular type of event, such
  20827.      as which key the user pressed or which window is being activated
  20828.  
  20829. Every event has an event record containing this information—even null events.
  20830.  
  20831. Event records are defined as follows:
  20832.  
  20833. TYPE  EventRecord = RECORD
  20834.                       what:       INTEGER;  {event code}
  20835.                       message:    LONGINT;  {event message}
  20836.                       when:       LONGINT;  {ticks since startup}
  20837.                       where:      Point;    {mouse location}
  20838.                       modifiers:  INTEGER   {modifier flags}
  20839.                     END;
  20840.  
  20841. The when field contains the number of ticks since the system last started up, and the
  20842. where field gives the location of the mouse, in global coordinates, at the time the
  20843. event was posted. The other three fields are described below.
  20844.  
  20845. _______________________________________________________________________________
  20846.  
  20847. »Event Code
  20848.  
  20849. The what field of an event record contains an event code identifying the type of the
  20850. event. The event codes are available as predefined constants:
  20851.  
  20852. CONST  nullEvent   =  0;    {null}
  20853.        mouseDown   =  1;    {mouse-down}
  20854.        mouseUp     =  2;    {mouse-up}
  20855.        keyDown     =  3;    {key-down}
  20856.        keyUp       =  4;    {key-up}
  20857.        autoKey     =  5;    {auto-key}
  20858.        updateEvt   =  6;    {update}
  20859.        diskEvt     =  7;    {disk-inserted}
  20860.        activateEvt =  8;    {activate}
  20861.        networkEvt  = 10;    {network}
  20862.        driverEvt   = 11;    {device driver}
  20863.        app1Evt     = 12;    {application-defined}
  20864.        app2Evt     = 13;    {application-defined}
  20865.        app3Evt     = 14;    {application-defined}
  20866.        app4Evt     = 15;    {application-defined}
  20867.  
  20868. _______________________________________________________________________________
  20869.  
  20870. »Event Message
  20871.  
  20872. The message field of an event record contains the event message, which conveys additional
  20873. important information about the event. The nature of this information depends on the
  20874. event type, as summarized in the following table and described below.
  20875.  
  20876.   Event type             Event message
  20877.  
  20878.   Keyboard               Character code, key code, and ADB address field
  20879.   Activate, update       Pointer to window
  20880.   Disk-inserted          Drive number in low-order word, File Manager
  20881.                          result code in high-order word
  20882.   Mouse-down,            Undefined
  20883.   mouse-up, null
  20884.   Network                Handle to parameter block
  20885.   Device driver          See chapter describing driver
  20886.   Application-defined    Whatever you wish
  20887.  
  20888. For keyboard events, the low-order byte of the low-order word of the event message
  20889. contains the ASCII character code generated by the key or combination of keys that
  20890. was pressed or released; usually this is all you’ll need.  However, as described in
  20891. the Apple Desktop Bus chapter, the Macintosh II and SE can be connected to multiple
  20892. keyboards.  To identify the origin of keyboard events, the keyboard event message
  20893. contains a new ADB address field.  It now has the structure shown in Figure 2.
  20894.  
  20895. Warning:  The high byte of the event message for keyboard events is reserved
  20896.           for future use, and is not presently guaranteed to be zero.
  20897.  
  20898. The event message for non-keyboard events remains the same as described above.
  20899.  
  20900. •••Refer to Figure 2.•••
  20901.  
  20902. Figure 2–Event Message for Keyboard Events
  20903.  
  20904. The key code in the event message for a keyboard event represents the character key
  20905. that was pressed or released; this value is always the same for any given character
  20906. key, regardless of the modifier keys pressed along with it. Key codes are useful in
  20907. special cases—in a music generator, for example—where you want to treat the keyboard
  20908. as a set of keys unrelated to characters. Figure 3 gives the key codes for all the
  20909. keys on the keyboard and keypad. (Key codes are shown for modifier keys here because
  20910. they’re meaningful in other contexts, as explained later.) Both the U.S. and international
  20911. keyboards are shown; in some cases the codes are quite different (for example, space
  20912. and Enter are reversed).
  20913.  
  20914. Three keyboards are now available as standard equipment with Macintosh computers sold
  20915. in the U.S.  They are
  20916.  
  20917.   •  The Macintosh Plus Keyboard, which includes cursor control keys and an
  20918.      integral keypad.  Its layout and key coding is shown in Figure 4.
  20919.   •  The Macintosh II Keyboard, also shipped with the Macintosh SE, which
  20920.      adds Esc (Escape) and Control keys and is connected to the Apple Desktop
  20921.      Bus.  Its layout and key coding is shown in Figure 5.
  20922.   •  The Apple Extended Keyboard,  which the user may connect to the Apple
  20923.      Desktop Bus of any Macintosh II or Macintosh SE computer.  Its layout
  20924.      and key coding is shown in Figure 6.
  20925.  
  20926. These figures show the virtual key codes for each key; they are the key codes that
  20927. actually appear in keyboard events.  In the case of the Macintosh II and Apple Extended
  20928. Keyboards, however, the hardware produces raw key codes, which may be different.  Raw
  20929. key codes are translated to virtual key codes by the
  20930. 'KMAP' resource in the System Folder.  By modifying the 'KMAP' resource you can
  20931. change the key codes for any keys.  Similarly, you can change the ASCII codes corresponding
  20932. to specific key codes by modifying the 'KCHR' resource in the System Folder.  The
  20933. 'KMAP' and 'KCHR' resources are described in the Resource Manager chapter.
  20934.  
  20935. With both the Macintosh II and the Apple Extended keyboards, the standard 'KMAP'
  20936. resource supplied in the system folder reassigns the following raw key codes to
  20937. different virtual key codes:
  20938.  
  20939.   Key           Raw key code    Virtual key code
  20940.  
  20941.   Control           36                3B
  20942.   Left cursor       3B                7B
  20943.   Right cursor      3C                7C
  20944.   Down cursor       3D                7D
  20945.   Up cursor         3E                7E
  20946.  
  20947. The standard 'KMAP' resource leaves all other raw key codes and virtual key codes the
  20948. same.
  20949.  
  20950. With the Apple Extended Keyboard, the virtual key codes for three more keys may be
  20951. easily reassigned, as described above under “Reassigning Right Key Codes”.
  20952.  
  20953. The following predefined constants are available to help you access the character
  20954. code and key code:
  20955.  
  20956. CONST  charCodeMask = $000000FF;    {character code}
  20957.        keyCodeMask  = $0000FF00;    {key code}
  20958.  
  20959. •••Refer to Figure 3.•••
  20960.  
  20961. Figure 3–Key Codes
  20962.  
  20963. •••Refer to Figure 4.•••
  20964.  
  20965. Figure 4–Macintosh Plus Keyboard
  20966.  
  20967. •••Refer to Figure 5.•••
  20968.  
  20969. Figure 5–Macintosh II Keyboard
  20970.  
  20971. •••Refer to Figure 6.•••
  20972.  
  20973. Figure 6–Apple Extended Keyboard
  20974.  
  20975. Note:  You can use the Toolbox Utility function BitAnd with these constants;
  20976.        for instance, to access the character code, use
  20977.  
  20978.          charCode := BitAnd(my Event.message,charCodeMask)
  20979. _______________________________________________________________________________
  20980.  
  20981. THE TOOLBOX EVENT MANAGER                                           
  20982. _______________________________________________________________________________
  20983.  
  20984. For activate and update events, the event message is a pointer to the window affected.
  20985. (If the event is an activate event, additional important information about the event
  20986. can be found in the modifiers field of the event record, as described below.)
  20987.  
  20988. For disk-inserted events, the low-order word of the event message contains the drive
  20989. number of the disk drive into which the disk was inserted:  1 for the Macintosh’s
  20990. built-in drive, and 2 for the external drive, if any. Numbers greater than 2 denote
  20991. additional disk drives connected to the Macintosh. By the time your application
  20992. receives a disk-inserted event, the system will already have attempted to mount the
  20993. volume on the disk by calling the File Manager function MountVol; the high-order word
  20994. of the event message will contain the result code returned by MountVol.
  20995.  
  20996. For mouse-down, mouse-up, and null events, the event message is undefined and should
  20997. be ignored. The event message for a network event contains a handle to a parameter
  20998. block, as described in the AppleTalk Manager chapter. For device driver events, the
  20999. contents of the event message depend on the situation under which the event was
  21000. generated; the chapters describing those situations will give the details. Finally,
  21001. you can use the event message however you wish for application-defined event types.
  21002.  
  21003. _______________________________________________________________________________
  21004.  
  21005. »Modifier Flags
  21006.  
  21007. As mentioned above, the modifiers field of an event record contains further information
  21008. about activate events and the state of the modifier keys and mouse button at the time
  21009. the event was posted (see Figure 7). You might look at this field to find out, for
  21010. instance, whether the Command key was down when a mouse-down event was posted (which
  21011. in many applications affects the way objects are selected) or when a key-down event
  21012. was posted (which could mean the user is choosing a menu item by typing its keyboard
  21013. equivalent).
  21014.  
  21015. •••Refer to Figure 7.•••
  21016.  
  21017. Figure 7–Modifier Flags
  21018.  
  21019. The following predefined constants are useful as masks for reading the flags in the
  21020. modifiers field:
  21021.  
  21022. CONST  activeFlag = 1;     {set if window being activated}
  21023.        btnState   = 128;   {set if mouse button up}
  21024.        cmdKey     = 256;   {set if Command key down}
  21025.        shiftKey   = 512;   {set if Shift key down}
  21026.        alphaLock  = 1024;  {set if Caps Lock key down}
  21027.        optionKey  = 2048;  {set if Option key down}
  21028.        ControlKey = 4096;  {set if Control key down}
  21029.  
  21030. The activeFlag bit gives further information about activate events; it’s set if the
  21031. window pointed to by the event message is being activated, or 0 if the window is
  21032. being deactivated. The remaining bits indicate the state of the mouse button and
  21033. modifier keys. Notice that the btnState bit is set if the mouse button is up, whereas
  21034. the bits for the four modifier keys are set if their corresponding keys are down.
  21035.  
  21036. æKY GetNextEvent
  21037. æFc Events.h
  21038. æT Function
  21039. æTN A970
  21040. æD pascal Boolean GetNextEvent(short eventMask,EventRecord *theEvent)
  21041.     = 0xA970; 
  21042. æDT Boolean myVariable = GetNextEvent((short) eventMask,(EventRecord *) theEvent);
  21043. æMM
  21044. æRT 3, 5, 85, 194, 205 
  21045. æRI I-257, N3-1, N5-1, N85, P-30, 32, 34, 39, 40, 97, 108, 173
  21046. æC 
  21047. GetNextEvent returns the next available event of a specified type or types and, if
  21048. the event is in the event queue, removes it from the queue. The event is returned in
  21049. the parameter theEvent. The eventMask parameter specifies which event types are of
  21050. interest. GetNextEvent returns the next available event of any type designated by the
  21051. mask, subject to the priority rules discussed above under “Priority of Events”. If no
  21052. event of any of the designated types is available, GetNextEvent returns a null event.
  21053.  
  21054. Note:  Events in the queue that aren’t designated in the mask are kept in
  21055.        the queue; if you want to remove them, you can do so by calling the
  21056.        Operating System Event Manager procedure FlushEvents.
  21057.  
  21058. Before reporting an event to your application, GetNextEvent first calls the Desk
  21059. Manager function SystemEvent to see whether the system wants to intercept and respond
  21060. to the event. If so, or if the event being reported is a null event, GetNextEvent
  21061. returns a function result of FALSE; a function result of TRUE means that your application
  21062. should handle the event itself. The Desk Manager intercepts the following events:
  21063.  
  21064.   •  activate and update events directed to a desk accessory
  21065.   •  mouse-up and keyboard events, if the currently active window belongs to
  21066.      a desk accessory
  21067.  
  21068. Note:  In each case, the event is intercepted by the Desk Manager only if
  21069.        the desk accessory can handle that type of event; however, as a rule
  21070.        all desk accessories should be set up to handle activate, update, and
  21071.        keyboard events and should not handle mouse-up events.
  21072.  
  21073. The Desk Manager also intercepts disk-inserted events:  It attempts to mount the
  21074. volume on the disk by calling the File Manager function MountVol. GetNextEvent will
  21075. always return TRUE in this case, though, so that your application can take any further
  21076. appropriate action after examining the result code returned by MountVol in the event
  21077. message. (See the Desk Manager and File Manager chapters.) GetNextEvent returns TRUE
  21078. for all other non-null events
  21079. (including all mouse-down events, regardless of which window is active), leaving them
  21080. for your application to handle.
  21081.  
  21082. GetNextEvent also makes the following processing happen, invisible to your program:
  21083.  
  21084.   •  If the “alarm” is set and the current time is the alarm time, the alarm
  21085.      goes off (a beep followed by blinking the apple symbol in the menu bar).
  21086.      The user can set the alarm with the Alarm Clock desk accessory.
  21087.   •  If the user holds down the Command and Shift keys while pressing a
  21088.      numeric key that has a special effect, that effect occurs. The standard
  21089.      such keys are 1 and 2 for ejecting the disk in the internal or external
  21090.      drive, and 3 and 4 for writing a snapshot of the screen to a MacPaint
  21091.      document or to the printer.
  21092.  
  21093. Note:  Advanced programmers can implement their own code to be executed in
  21094.        response to Command-Shift-number combinations (except for Command-
  21095.        Shift-1 and 2, which can’t be changed). The code corresponding to a
  21096.        particular number must be a routine having no parameters, stored in
  21097.        a resource whose type is 'FKEY' and whose ID is the number. The
  21098.        system resource file contains code for the numbers 3 and 4.
  21099.  
  21100. Assembly-language note:  You can disable GetNextEvent’s processing of Command-
  21101.                          Shift-number combinations by setting the global
  21102.                          variable ScrDmpEnb (a byte) to 0.
  21103.  
  21104. æKY WaitNextEvent
  21105. æFc Events.h
  21106. æT Function
  21107. æTN A860
  21108. æD pascal Boolean WaitNextEvent(short mask,EventRecord *event,unsigned long sleep,
  21109.     RgnHandle mouseRgn)
  21110.     = 0xA860; 
  21111. æDT Boolean myVariable = WaitNextEvent((short) mask,(EventRecord *) event,(unsigned long) sleep,()
  21112.     RgnHandle mouseRgn);
  21113. æRT 158, 177, 180, 194, 205
  21114. æRI N158-1
  21115. æC 
  21116.  
  21117. æKY EventAvail
  21118. æFc Events.h
  21119. æT Function
  21120. æTN A971
  21121. æD pascal Boolean EventAvail(short eventMask,EventRecord *theEvent)
  21122.     = 0xA971; 
  21123. æDT Boolean myVariable = EventAvail((short) eventMask,(EventRecord *) theEvent);
  21124. æMM
  21125. æRT 194
  21126. æRI I-259
  21127. æC 
  21128. EventAvail works exactly the same as GetNextEvent except that if the event is in the
  21129. event queue, it’s left there.
  21130.  
  21131. Note:  An event returned by EventAvail will not be accessible later if in
  21132.        the meantime the queue becomes full and the event is discarded from
  21133.        it; since the events discarded are always the oldest ones in the queue,
  21134.        however, this will happen only in an unusually busy environment.
  21135.  
  21136. æKY GetMouse
  21137. æFc Events.h
  21138. æT Function
  21139. æTN A972
  21140. æD pascal void GetMouse(Point *mouseLoc)
  21141.     = 0xA972; 
  21142. æDT GetMouse((Point *) mouseLoc);
  21143. æMM
  21144. æRI I-259
  21145. æC  
  21146. GetMouse returns the current mouse location in the mouseLoc parameter. The location
  21147. is given in the local coordinate system of the current grafPort (which might be, for
  21148. example, the currently active window). Notice that this differs from the mouse location
  21149. stored in the where field of an event record; that location is always in global
  21150. coordinates.
  21151.  
  21152. æKY Button
  21153. æFc Events.h
  21154. æT Function
  21155. æTN A974
  21156. æD pascal Boolean Button(void)
  21157.     = 0xA974; 
  21158. æDT Boolean myVariable = Button()(void);
  21159. æMM
  21160. æRI I-259
  21161. æC 
  21162. The Button function returns TRUE if the mouse button is currently down, and FALSE if
  21163. it isn’t.
  21164.  
  21165. æKY StillDown
  21166. æFc Events.h
  21167. æT Function
  21168. æTN A973
  21169. æD pascal Boolean StillDown(void)
  21170.     = 0xA973; 
  21171. æDT Boolean myVariable = StillDown()(void);
  21172. æMM
  21173. æRT 194
  21174. æRI I-259
  21175. æC 
  21176. Usually called after a mouse-down event, StillDown tests whether the mouse button is
  21177. still down. It returns TRUE if the button is currently down and there are no more
  21178. mouse events pending in the event queue. This is a true test of whether the button is
  21179. still down from the original press—unlike Button (above), which returns TRUE whenever
  21180. the button is currently down, even if it has been released and pressed again since
  21181. the original mouse-down event.
  21182.  
  21183. æKY WaitMouseUp
  21184. æFc Events.h
  21185. æT Function
  21186. æTN A977
  21187. æD pascal Boolean WaitMouseUp(void)
  21188.     = 0xA977; 
  21189. æDT Boolean myVariable = WaitMouseUp()(void);
  21190. æMM
  21191. æRT 194
  21192. æRI I-259
  21193. æC 
  21194. WaitMouseUp works exactly the same as StillDown (above), except that if the button is
  21195. not still down from the original press, WaitMouseUp removes the preceding mouse-up
  21196. event before returning FALSE. If, for instance, your application attaches some special
  21197. significance both to mouse double-clicks and to mouse-up events, this function would
  21198. allow your application to recognize a double-click without being confused by the
  21199. intervening mouse-up.
  21200.  
  21201. æKY GetKeys
  21202. æFc Events.h
  21203. æT Function
  21204. æTN A976
  21205. æD pascal void GetKeys(KeyMap theKeys)
  21206.     = 0xA976; 
  21207. æDT GetKeys((KeyMap) theKeys);
  21208. æMM
  21209. æRI I-259
  21210. æC 
  21211. GetKeys reads the current state of the keyboard (and keypad, if any) and returns it
  21212. in the form of a keyMap:
  21213.  
  21214. TYPE KeyMap = PACKED ARRAY[0..127] OF BOOLEAN;
  21215.  
  21216. Each key on the keyboard or keypad corresponds to an element in the keyMap. The index
  21217. into the keyMap for a particular key is the same as the key code for that key. (The
  21218. key codes are shown in Figure 3 above.) The keyMap element is TRUE if the corresponding
  21219. key is down and FALSE if it isn’t. The maximum number of keys that can be down simultaneously
  21220. is two character keys plus any combination of the four modifier keys.
  21221.  
  21222. æKY TickCount
  21223. æFc Events.h
  21224. æT Function
  21225. æTN A975
  21226. æD pascal unsigned long TickCount(void)
  21227.     = 0xA975; 
  21228. æDT unsigned long myVariable = TickCount()(void);
  21229. æMM
  21230. æRI I-260
  21231. æC 
  21232. TickCount returns the current number of ticks (sixtieths of a second) since the
  21233. system last started up.
  21234.  
  21235. Warning:  Don’t rely on the tick count being exact; it will usually be
  21236.           accurate to within one tick, but may be off by more than that. The
  21237.           tick count is incremented during the vertical retrace interrupt,
  21238.           but it’s possible for this interrupt to be disabled. Furthermore,
  21239.           don’t rely on the tick count being incremented to a certain value,
  21240.           such as testing whether it has become equal to its old value plus 1;
  21241.           check instead for “greater than or equal to” (since an interrupt
  21242.           task may keep control for more than one tick).
  21243.  
  21244. Assembly-language note:  The value returned by this function is also contained
  21245.                          in the global variable Ticks.
  21246.  
  21247. æKY GetDblTime
  21248. æFc Events.h
  21249. æT Function
  21250. æD pascal unsigned long GetDblTime(void)
  21251.     = {0x2EB8,0x02F0}; 
  21252. æDT unsigned long myVariable = GetDblTime()(void);
  21253. æRI I-260
  21254. æC 
  21255. [Not in ROM]
  21256.  
  21257. GetDblTime returns the suggested maximum difference (in ticks) that should exist
  21258. between the times of a mouse-up event and a mouse-down event for those two mouse
  21259. clicks to be considered a double-click. The user can adjust this value by means of
  21260. the Control Panel desk accessory.
  21261.  
  21262. Assembly-language note:  This value is available to assembly-language
  21263.                          programmers in the global variable DoubleTime.
  21264.  
  21265. æKY GetCaretTime
  21266. æFc Events.h
  21267. æT Function
  21268. æD pascal unsigned long GetCaretTime(void)
  21269.     = {0x2EB8,0x02F4}; 
  21270. æDT unsigned long myVariable = GetCaretTime()(void);
  21271. æRI I-260
  21272. æC 
  21273. [Not in ROM]
  21274.  
  21275. GetCaretTime returns the time (in ticks) between blinks of the “caret” (usually a
  21276. vertical bar) marking the insertion point in editable text. If you aren’t using
  21277. TextEdit, you’ll need to cause the caret to blink yourself; on every pass through
  21278. your program’s main event loop, you should check this value against the elapsed time
  21279. since the last blink of the caret. The user can adjust this value by means of the
  21280. Control Panel desk accessory.
  21281.  
  21282. Assembly-language note:  This value is available to assembly-language
  21283.                          programmers in the global variable CaretTime.
  21284.  
  21285.  
  21286. æKY FCntl.h
  21287. æC 
  21288. close    faccess    open    unlink
  21289. creat    fcntl      read    write
  21290. dup      lseek      
  21291.  
  21292. F_DELETE       F_OPEN         O_APPEND    O_RDWR
  21293. F_DUPFD        F_RENAME       O_CREAT     O_RSRC
  21294. F_GFONTINFO    F_SFONTINFO    O_EXCL      O_TRUNC
  21295. F_GPRINTREC    F_SPRINTREC    O_RDONLY    O_WRONLY
  21296. F_GTABINFO     F_STABINFO     
  21297.  
  21298. Low-level file I/O (non-ANSI extensions)—FCntl.h
  21299. non-ANSI extensions:low-level file I/O
  21300. MPW 3.0 C contains several file-control functions in addition to those required  
  21301. by the ANSI draft C standard. These functions, declared in the header file  
  21302. FCntl.h, preserve compatibility with MPW 2.0 C. 
  21303. Some of these functions duplicate, at a lower level, functions in the header  
  21304. file StdIO.h. (For example, open is a low-level equivalent of fopen.) Using  
  21305. the StdIO.h functions whenever possible will improve portability and robustness.
  21306.  
  21307. æKY close
  21308. æFc FCntl.h
  21309. æC                           Synopsis
  21310.  
  21311. #include <FCntl.h>
  21312. int close(int fildes);
  21313.  
  21314.                            Description
  21315.  
  21316. The close; function closes the file descriptor indicated by fildes. 
  21317. Parameter fildes is a file descriptor obtained from an open, creat, 
  21318. dup, or fcntl call. 
  21319. The function close fails if fildes is not a valid open file descriptor [EBADF].
  21320.  
  21321.                           Diagnostics
  21322.  
  21323. Upon successful completion, a value of 0 is returned. Otherwise, a value 
  21324. of –1 is returned and errno is set to indicate the error.
  21325.  
  21326. See also
  21327. creat, dup, fclose, fcntl, ferror, open, stdio
  21328.  
  21329. æKY creat
  21330. æFc FCntl.h
  21331. æC                           Synopsis
  21332.  
  21333. #include <FCntl.h>
  21334. int creat(const char *filename);
  21335.  
  21336.                            Description
  21337.  
  21338. The creat; function creates a new file or prepares to rewrite an existing  
  21339. file, filename. If the file exists, the length of its data fork is set to 0.
  21340. The function creat(filename) is equivalent to open(filename,  
  21341. O_WRONLY|O_TRUNC|O_CREAT)
  21342.  
  21343. Upon successful completion, a nonnegative integer (the file descriptor)  
  21344. is returned and the file is open for writing. The file pointer is set to  
  21345. the beginning of the file. A maximum of about 30 files may be open at a  
  21346. given time: the actual maximum depends upon the current system environment.
  21347.  
  21348.                           Return value
  21349.  
  21350. Upon successful completion, a nonnegative integer (the file descriptor)  
  21351. is returned. Otherwise, a value of –1 is returned and errno is set to  
  21352. indicate the error.
  21353.  
  21354.                            Note
  21355.  
  21356. Other implementations of creat specify a second parameter, mode. This version 
  21357. ignores any second parameter.
  21358.  
  21359. See also
  21360. close, open, read, write
  21361.  
  21362. æKY dup
  21363. æFc FCntl.h
  21364. æC                           Synopsis
  21365.  
  21366. #include <Fcntl.h>
  21367. int dup(int fildes);
  21368.  
  21369.                            Description
  21370.  
  21371. The dup; function returns a new file descriptor with these features:
  21372.  It refers to the same open file as the original.
  21373.  It uses the same file pointer as the original.
  21374.  It has the same access mode (that is, read, write, or read/write) as the 
  21375.  original.
  21376. The fildes parameter is a file descriptor obtained from an open, creat, 
  21377. dup, or fcntl call. The new file descriptor returned by dup is the lowest 
  21378. one available.
  21379. The function call dup(fildes) is equivalent to fcntl(fildes, F_DUPFD, 0).
  21380. The dup function fails if parameter fildes is not a valid open file descriptor 
  21381. [EBADF].
  21382.  
  21383.                           Return value
  21384.  
  21385. Upon successful completion, a nonnegative integer (the file descriptor) 
  21386. is returned. Otherwise, a value of –1 is returned and errno is set to 
  21387. indicate the error.
  21388.  
  21389. See also
  21390. close, fcntl, ferror, open
  21391.  
  21392. æKY F_DELETE
  21393. æFc FCntl.h
  21394. æD #define F_DELETE (('d'<<8)|01)
  21395.  
  21396.  
  21397. æKY F_DUPFD
  21398. æFc FCntl.h
  21399. æD #define F_DUPFD  0 /*Duplicate fildes*/
  21400.  
  21401.  
  21402. æKY F_GFONTINFO
  21403. æFc FCntl.h
  21404. æD #define F_GFONTINFO  (('e'<<8)|02)
  21405.  
  21406.  
  21407. æKY F_GPRINTREC
  21408. æFc FCntl.h
  21409. æD #define F_GPRINTREC  (('e'<<8)|04)
  21410.  
  21411.  
  21412. æKY F_GTABINFO
  21413. æFc FCntl.h
  21414. æD #define F_GTABINFO   (('e'<<8)|00) /*'e' => "editor" ops*/
  21415.  
  21416.  
  21417. æKY F_OPEN
  21418. æFc FCntl.h
  21419. æD #define F_OPEN   (('d'<<8)|00) /*d' => "directory" ops*/
  21420.  
  21421.  
  21422. æKY F_RENAME
  21423. æFc FCntl.h
  21424. æD #define F_RENAME (('d'<<8)|02)
  21425.  
  21426.  
  21427. æKY F_SFONTINFO
  21428. æFc FCntl.h
  21429. æD #define F_SFONTINFO  (('e'<<8)|03)
  21430.  
  21431.  
  21432. æKY F_SPRINTREC
  21433. æFc FCntl.h
  21434. æD #define F_SPRINTREC  (('e'<<8)|05)
  21435.  
  21436.  
  21437. æKY F_STABINFO
  21438. æFc FCntl.h
  21439. æD #define F_STABINFO   (('e'<<8)|01)
  21440.  
  21441.  
  21442. æKY faccess
  21443. æFc FCntl.h
  21444. æC                           Synopsis
  21445.  
  21446. #include <FCntl.h>
  21447. int faccess(const char *filename, unsigned int cmd, long *arg);
  21448.  
  21449.                            Description
  21450.  
  21451. The faccess; function provides access to control and status information for 
  21452. named files. (Compare function ioctl, which provides different control and 
  21453. status information for open files.)
  21454. The cmd parameter must be set to one of the constants in the following list 
  21455. to indicate what operation is to be performed on the file. As Noted in the 
  21456. list, some calls to faccess also require the arg parameter, usually as a 
  21457. long or as a pointer to a long.
  21458. The following commands are available to all programs:
  21459. Value of cmd   Description
  21460.  
  21461. F_DELETE Deletes the named file, or returns an error if the file is open. 
  21462.          Parameter arg is ignored.
  21463. F_RENAME Renames the named file. Parameter arg is a pointer to a string 
  21464.          containing the new name.
  21465.  
  21466. The following commands can be used only by MPW tools:
  21467. Value of cmd Description
  21468.  
  21469. F_GTABINFO   Gets the tab offset for the MPW text file filename. The tab 
  21470.              offset is stored in the long integer pointed to by arg.
  21471.              The tab offset is expressed as an integer number of spaces. 
  21472.              The width of the space character in the current font determines 
  21473.              the actual distance of the tab offset.
  21474. F_STABINFO   Sets the tab offset for the MPW text file filename. The tab 
  21475.              offset is specified as a long value in arg.
  21476. F_GFONTINFO  Gets the font number and font size for an MPW text file 
  21477.              filename. The font number is stored in the high-order half 
  21478.              of the long pointed to by arg; the font size is stored in the 
  21479.              low order half of the same long.
  21480. F_SFONTINFO  Sets the font number and font size for the MPW text file, 
  21481.              filename. The font number is specified in the high-order half 
  21482.              of arg; the font size is specified in the low-order half of arg.
  21483. F_GPRINTREC  Gets a print record TPrint for an MPW text file, filename; arg 
  21484.              is a handle to the print record.
  21485. F_SPRINTREC  Sets a print record for the MPW text file filename; arg is a 
  21486.              handle to the print record.
  21487. F_OPE        Reserved for operating system use.
  21488. F_GSELINFO   Gets the selection information for the MPW text file filename.
  21489. F_SSELINFO   Sets the selection information for the MPW text file filename.
  21490. F_GWININFO   Gets the current window position.
  21491. F_SWININFO   Sets the current window position.
  21492.  
  21493. The commands F_GTABINFO and F_GFONTINFO pass arg as a pointer to a long; 
  21494. F_STABINFO and F_SFONTINFO pass arg as a long value; and F_GPRINTREC and 
  21495. F_SPRINTREC pass arg as a handle to a print record.
  21496.  
  21497.                            Return values
  21498.  
  21499. Upon successful completion, faccess returns a nonnegative value, usually 0. 
  21500. If the device for the named file cannot perform the requested command, 
  21501. faccess returns –1 and errno is set to indicate the error.
  21502. If the requested resource for F_GTABINFO, F_GFONTINFO, or F_GPRINTREC 
  21503. does not exist for the named file, default values are stored and the 
  21504. function returns a value greater than 0.
  21505.  
  21506.                            Note
  21507.  
  21508. Before faccess is called with F_GPRINTREC or F_SPRINTREC, the 
  21509. Printing Manager must be initialized and the print record handle THPrint 
  21510. must be allocated. The font size must be 9, 10, 12, 14, 18, or 24; the 
  21511. font number must be 0 or a positive integer. The following sequence must 
  21512. be used with these print command values:
  21513. res = CurResFile();
  21514. PRClose();
  21515. UseResFile(res);
  21516. PROpen();
  21517.  /* do whatever, including call faccess print commands */
  21518. PRClose();
  21519. UseResFile(res);
  21520.  
  21521. See also
  21522. ioctl, unlink
  21523.  
  21524. æKY fcntl
  21525. æFc FCntl.h
  21526. æC                           Synopsis
  21527.  
  21528. #include <FCntl.h>
  21529. int fcntl(int fildes, unsigned int cmd, int arg);
  21530.  
  21531.                            Description
  21532.  
  21533. The fcntl; function duplicates a file descriptor. A file 
  21534. remains open until all of its file descriptors are closed.
  21535. The fildes parameter is an open file descriptor obtained from 
  21536. an open, creat, dup, or fcntl call. The cmd parameter takes the 
  21537. value F_DUPFD, which tells fcntl to return the lowest-numbered 
  21538. available file descriptor greater than or equal to arg. Normally 
  21539. arg is greater than or equal to 3, to avoid obtaining the standard 
  21540. file descriptors 0, 1, and 2. The function fcntl returns a new 
  21541. file descriptor that points to the same open file as fildes. The 
  21542. new file descriptor has the same access mode (read, write, or 
  21543. read/write) and file pointer as fildes. Any I/O operation 
  21544. changes the file pointer for all file descriptors that share it.
  21545.  
  21546. The fcntl function fails if one or more of the following error 
  21547. conditions are true:
  21548.  Parameter fildes is not a valid open file descriptor [EBADF].
  21549.  Parameter arg is negative or greater than the highest 
  21550.  allowable file descriptor [EINVAL].
  21551.  
  21552.                            Return values
  21553.  
  21554. Upon successful completion, the value returned is a new file 
  21555. descriptor. Otherwise, a value of –1 is returned and errno is 
  21556. set to indicate the error.
  21557.  
  21558.                            Note
  21559.  
  21560. MPW 3.0 C does not support the F_GETFD, F_SETFD, F_GETFL, and 
  21561. F_SETFL commands of fcntl.
  21562.  
  21563. See also
  21564. close, dup, ferror, ioctl, open
  21565.  
  21566. æKY lseek
  21567. æFc FCntl.h
  21568. æC                           Synopsis
  21569.  
  21570. #include <FCntl.h>
  21571. #define SEEK_SET 0
  21572. #define SEEK_CUR 1
  21573. #define SEEK_END 2
  21574. long lseek(int fildes, long int offset, int whence);
  21575.  
  21576.                            Description
  21577.  
  21578. A file descriptor, fildes, is returned from a call to creat, dup, fcntl, 
  21579. or open. The lseek; function sets the file pointer associated with fildes, 
  21580. thus determining the position of the next read or write operation. 
  21581. The value of whence determines how the offset parameter is used, according 
  21582. to these rules:
  21583.  If whence is SEEK_SET, the new position is offset bytes from the beginning 
  21584.  of the file.
  21585.  If whence is SEEK_CUR, the new position is the current location plus offset.
  21586.  If whence is SEEK_END, the new position is the size of the file plus offset.
  21587.  If whence is SEEK_SET or SEEK_CUR, the value of offset may be negative.
  21588. Upon successful completion, the file-pointer value as measured in bytes from 
  21589. the beginning of the file is returned.
  21590. The file pointer remains unchanged and lseek fails if one or more of the 
  21591. following error conditions are true:
  21592.  File descriptor fildes is not open [EBADF].
  21593.  Parameter whence is not equal to SEEK_SET, SEEK_CUR, or SEEK_END [EINVAL].
  21594.  The resulting file pointer would point past the end-of-file [ESPIPE].
  21595.  The resulting file pointer would point before the beginning of the file [EINVAL].
  21596. Some devices are incapable of seeking. The value of the file pointer associated 
  21597. with such a device is undefined.
  21598.  
  21599.                            Return values
  21600.  
  21601. Upon successful completion, a nonnegative long integer indicating the 
  21602. file-pointer value is returned. Otherwise, a value of –1 is returned 
  21603. and errno is set to indicate the error.
  21604.  
  21605.                            Note
  21606.  
  21607. In previous versions of the Standard C Library, tell;(fildes) was a function 
  21608. that returned the current file position. It is equivalent to the call 
  21609. lseek(fildes, 0L, 1).
  21610.  
  21611.                            Warning
  21612.  
  21613. The lseek function has no effect on a file opened with the O_APPEND flag 
  21614. because the next write to the file always repositions the file pointer to 
  21615. the end before writing.
  21616.  
  21617. See also
  21618. ferror, fseek, open, stdio, write
  21619.  
  21620. æKY O_APPEND
  21621. æFc FCntl.h
  21622. æD #define O_APPEND (1<<3) /*append (writes guaranteed at the end)*/
  21623.  
  21624.  
  21625. æKY O_CREAT
  21626. æFc FCntl.h
  21627. æD #define O_CREAT  (1<<8) /*Open with file create*/
  21628.  
  21629.  
  21630. æKY O_EXCL
  21631. æFc FCntl.h
  21632. æD #define O_EXCL   (1<<10) /*Exclusive open*/
  21633.  
  21634.  
  21635. æKY O_RDONLY
  21636. æFc FCntl.h
  21637. æD #define O_RDONLY 0 /*Bits 0 and 1 are used internally*/
  21638.  
  21639.  
  21640. æKY O_RDWR
  21641. æFc FCntl.h
  21642. æD #define O_RDWR   2
  21643.  
  21644.  
  21645. æKY O_RSRC
  21646. æFc FCntl.h
  21647. æD #define O_RSRC   (1<<4) /*Open the resource fork*/
  21648.  
  21649.  
  21650. æKY O_TRUNC
  21651. æFc FCntl.h
  21652. æD #define O_TRUNC  (1<<9) /*Open with truncation*/
  21653.  
  21654.  
  21655. æKY O_WRONLY
  21656. æFc FCntl.h
  21657. æD #define O_WRONLY 1 /*Values 0..2 are historical*/
  21658.  
  21659.  
  21660. æKY open
  21661. æFc FCntl.h
  21662. æC                           Synopsis
  21663.  
  21664. #include <FCntl.h>
  21665. int open(const char *filename, int oflag);
  21666.  
  21667.                            Description
  21668.  
  21669. The open; function opens a file descriptor for the named file and sets the  
  21670. file-status flags according to the value of oflag. The parameter filename 
  21671. is a disk file, window, selection, or pseudofile. (See “Pseudo-Filenames”  
  21672. in Chapter 5 of the Macintosh Programmer’s Workshop 3.0 Reference for more  
  21673. information.) The value of oflag is constructed by performing an OR operation 
  21674. on the flag settings, for example:
  21675. fildes = open("MyFile", O_WRONLY|O_CREAT|O_TRUNC);
  21676. To construct oflag, first select one of the following access modes:
  21677.  O_RDONLY    Open for reading only.
  21678.  WR_ONLY     Open for writing only.
  21679.  O_RDWR      Open for reading and writing.
  21680.  
  21681. Then optionally add one or more of these modifiers:
  21682.  O_APPEND    The file pointer is set to the end of the file before each write.
  21683.  O_CREAT     If the file does not exist, it is created.
  21684.  O_TRUNC     If the file exists, its length is truncated to 0; the mode is  
  21685.              unchanged.
  21686.  O_RSRC      The file’s resource fork is opened. (Normally, the data fork is  
  21687.              opened.)
  21688.  O_BINARY    Open as a binary stream (supported but not used by the system).
  21689.  
  21690. The following setting is valid only if O_CREAT is also specified:
  21691.  O_EXCL      The function open fails if the file exists.
  21692.              Upon successful completion, a nonnegative integer (the file  
  21693.              descriptor) is returned. The file pointer used to mark the  
  21694.              current position within the file is set to the beginning of  
  21695.              the file.
  21696.  
  21697. The named file is opened unless one or more of the following error  
  21698. conditions is true:
  21699.  O_CREAT is not set and the named file does not exist [ENOENT].
  21700.  More than about 30 file descriptors are currently open. The actual limit 
  21701.  varies according to run-time conditions [EMFILE].
  21702.  O_CREAT and O_EXCL are set and the named file exists [EEXIST].
  21703.  
  21704.                           Return value
  21705.  
  21706. Upon successful completion, a nonnegative integer (the file descriptor)  
  21707. is returned. Otherwise, a value of –1 is returned and errno is set to  
  21708. indicate the error.
  21709.  
  21710. See also
  21711. close, creat, dup, fcntl, ferror, fopen, lseek, read, stdio, write
  21712.  
  21713. æKY read
  21714. æFc FCntl.h
  21715. æC                           Synopsis
  21716.  
  21717. #include <Fcntl.h>
  21718. int read(int fildes, char* buf, unsigned long nbyte);
  21719.  
  21720.                            Description
  21721.  
  21722. The read; function transfers up to nbyte bytes from the file associated 
  21723. with fildes into the buffer pointed to by buf. File descriptor fildes is
  21724. obtained from a call to open, creat, a, or a.
  21725. On devices capable of seeking, read starts reading at the current position 
  21726. of the file pointer associated with fildes. Upon return from read, the 
  21727. file pointer is incremented by the number of bytes actually read.
  21728. Nonseeking devices always read from the current position. The value of a 
  21729. file pointer associated with such a file is undefined.
  21730.  
  21731. Upon successful completion, read returns the number of bytes actually read 
  21732. and placed in the buffer. This number may be less than nbyte if the file 
  21733. is associated with a window or if the number of bytes left in the file is 
  21734. less than nbyte bytes. A value of 0 is returned when an end-of-file has 
  21735. been reached, and a value of –1 is returned if a read error occurred.
  21736. The function read fails if fildes is not a valid file descriptor open for
  21737. reading. [EBADF]
  21738. File descriptor 0 is opened by the MPW Shell as standard input.
  21739.  
  21740.                            Return values
  21741.  
  21742. Upon successful completion, a nonnegative integer is returned, indicating 
  21743. the number of bytes actually read. Otherwise, –1 is returned and errno is 
  21744. set to indicate the error.
  21745.  
  21746. See also
  21747. creat, ferror, fread, open, stdio
  21748.  
  21749. æKY unlink
  21750. æFc FCntl.h
  21751. æC                           Synopsis
  21752.  
  21753. #include <FCntl.h>
  21754. int unlink(const char *fileName);
  21755.  
  21756.                            Description
  21757.  
  21758. The unlink; function deletes the named file. The function fails if the 
  21759. named file is open. This function is the UNIX (and MPW 2.0 C) equivalent
  21760.  of the ANSI remove function, and is included for compatibility.
  21761. A call to unlink is equivalent to faccess(fileName, F_DELETE, 0)
  21762.  
  21763.                           Diagnostics
  21764.  
  21765. Upon successful completion, a value of 0 is returned. Otherwise, a value 
  21766. of –1 is returned and errno is set to indicate the error.
  21767.  
  21768. See also
  21769. faccess
  21770.  
  21771. æKY write
  21772. æFc FCntl.h
  21773. æC                           Synopsis
  21774.  
  21775. #include <Fcntl.h>
  21776. int write(int fildes, const char* buf, unsigned long nbyte);
  21777.  
  21778.                            Description
  21779.  
  21780. The write; function attempts to write nbyte bytes from the buffer pointed 
  21781. to by buf to the file associated with the fildes. File descriptor fildes 
  21782. is obtained from an open, creat, dup, or fcntl call. Internal limitations 
  21783. may cause write to write fewer bytes than requested; the number of bytes 
  21784. actually written is indicated by the return value. Several calls to write 
  21785. may therefore be necessary to write out the contents of buf.
  21786. On devices capable of seeking, the actual writing of data proceeds from the 
  21787. position in the file indicated by the file pointer. Upon return from write, 
  21788. the file pointer is incremented by the number of bytes actually written.
  21789. On nonseeking devices, writing starts at the current position. The value of 
  21790. a file pointer associated with such a device is undefined.
  21791. If the O_APPEND file-status flag set in open is on, the file pointer is set 
  21792. to end-of-file before each write.
  21793. The file pointer remains unchanged and write fails if fildes is not a valid 
  21794. file descriptor open for writing [EBADF].
  21795. If you try to write more bytes than there is room for on the device, write 
  21796. writes as many bytes as possible. For example, if nbyte is 512 and there is 
  21797. room for 20 bytes more on the device, write writes 20 bytes and returns a 
  21798. value of 20. The next attempt to write a nonzero number of bytes will return 
  21799. an error [ENOSPC].
  21800. File descriptor 1 is opened by the MPW Shell as standard output; file 
  21801. descriptor 2, as standard error.
  21802.  
  21803.                           Return value
  21804.  
  21805. Upon successful completion, the number of bytes actually written is returned. 
  21806. Otherwise, –1 is returned and errno is set to indicate the error.
  21807.  
  21808. See also
  21809. creat, ferror, fread, lseek, open, stdio
  21810.  
  21811. æKY closeæ
  21812. æDT 
  21813. int myVariabel = close((int) fildes);
  21814.  
  21815. æKY creatæ
  21816. æDT
  21817. int myVariable = creat((const char *)filename);
  21818.  
  21819. æKY dupæ
  21820. æDT 
  21821. int myVariable = dup((int) fildes);
  21822.  
  21823. æKY faccessæ
  21824. æDT 
  21825. int myVariablle =faccess((const char *)filename, (unsigned int) cmd, (long *)arg);
  21826.  
  21827. æKY fcntlæ
  21828. æDT 
  21829. int myVaraible = fcntl((int) fildes, (unsigned int) cmd, (int) arg);
  21830.  
  21831. æKY lseekæ
  21832. æDT 
  21833. long myVariable = lseek((int) fildes, (long int) offset, (int) whence);
  21834.  
  21835. æKY openæ
  21836. æDT 
  21837. int myVariable = open((const char *)filename, (int) oflag);
  21838.  
  21839. æKY readæ
  21840. æDT 
  21841. int myVariable = read((int) fildes, (char*) buf, (unsigned long) nbyte);
  21842.  
  21843. æKY unlinkæ
  21844. æDT 
  21845. int myVariable = unlink((const char *)fileName);
  21846.  
  21847.  
  21848. æKY writeæ
  21849. æDT 
  21850. int myVariable = write((int) fildes, (const char*) buf, (unsigned long) nbyte);
  21851.  
  21852.  
  21853. æKY Files.h
  21854. æKL AddDrive
  21855. Allocate
  21856. AllocContig
  21857. CatMove
  21858. CloseWD
  21859. Create
  21860. create
  21861. DirCreate
  21862. Eject
  21863. eject
  21864. FInitQueue
  21865. flushvol
  21866. FlushVol
  21867. FSClose
  21868. FSDelete
  21869. fsdelete
  21870. fsopen
  21871. FSOpen
  21872. FSpCatMove
  21873. FSpCreate
  21874. FSpCreateResFile
  21875. FSpDelete
  21876. FSpDirCreate
  21877. FSpGetFInfo
  21878. FSpOpenDF
  21879. FSpOpenResFile
  21880. FSpOpenRF
  21881. FSpRename
  21882. FSpRstFLock
  21883. FSpSetFInfo
  21884. FSpSetFLock
  21885. FSRead
  21886. fsrename
  21887. FSWrite
  21888. GetDrvQHdr
  21889. GetEOF
  21890. GetFInfo
  21891. getfinfo
  21892. GetFPos
  21893. GetFSQHdr
  21894. GetVCBQHdr
  21895. getvinfo
  21896. GetVInfo
  21897. GetVol
  21898. getvol
  21899. GetVRefNum
  21900. GetWDInfo
  21901. HCreate
  21902. HDelete
  21903. HGetFInfo
  21904. HGetVol
  21905. HOpen
  21906. HOpenRF
  21907. HRename
  21908. HRstFLock
  21909. HSetFInfo
  21910. HSetFLock
  21911. HSetVol
  21912. MakeFSSpec
  21913. OpenRF
  21914. openrf
  21915. OpenWD
  21916. PBAllocate
  21917. PBAllocContig
  21918. PBCatMove
  21919. PBCatSearch
  21920. PBClose
  21921. PBCloseWD
  21922. PBCreate
  21923. PBCreateFileID
  21924. PBDelete
  21925. PBDeleteFileID
  21926. PBDirCreate
  21927. PBDTAddAPPL
  21928. PBDTAddIcon
  21929. PBDTCloseDown
  21930. PBDTDelete
  21931. PBDTFlush
  21932. PBDTGetAPPL
  21933. PBDTGetComment
  21934. PBDTGetIcon
  21935. PBDTGetIconInfo
  21936. PBDTGetInfo
  21937. PBDTGetPath
  21938. PBDTOpenInform
  21939. PBDTRemoveAPPL
  21940. PBDTRemoveComment
  21941. PBDTReset
  21942. PBDTSetComment
  21943. PBEject
  21944. PBExchangeFiles
  21945. PBFlushFile
  21946. PBFlushVol
  21947. PBGetAltAccess
  21948. PBGetCatInfo
  21949. PBGetEOF
  21950. PBGetFCBInfo
  21951. PBGetFInfo
  21952. PBGetFPos
  21953. PBGetVInfo
  21954. PBGetVol
  21955. PBGetWDInfo
  21956. PBHCopyFile
  21957. PBHCreate
  21958. PBHDelete
  21959. PBHGetDirAccess
  21960. PBHGetFInfo
  21961. PBHGetLogInInfo
  21962. PBHGetVInfo
  21963. PBHGetVol
  21964. PBHGetVolParms
  21965. PBHMapID
  21966. PBHMapName
  21967. PBHMoveRename
  21968. PBHOpen
  21969. PBHOpenDeny
  21970. PBHOpenDF
  21971. PBHOpenRF
  21972. PBHOpenRFDeny
  21973. PBHRename
  21974. PBHRstFLock
  21975. PBHSetDirAccess
  21976. PBHSetFInfo
  21977. PBHSetFLock
  21978. PBHSetVol
  21979. PBLockRange
  21980. PBMakeFSSpec
  21981. PBMountVol
  21982. PBOffLine
  21983. PBOpen
  21984. PBOpenDF
  21985. PBOpenRF
  21986. PBOpenWD
  21987. PBRead
  21988. PBRename
  21989. PBResolveFileID
  21990. PBRstFLock
  21991. PBSetAltAccess
  21992. PBSetCatInfo
  21993. PBSetEOF
  21994. PBSetFInfo
  21995. PBSetFLock
  21996. PBSetFPos
  21997. PBSetFVers
  21998. PBSetVInfo
  21999. PBSetVol
  22000. PBUnlockRange
  22001. PBUnmountVol
  22002. PBWrite
  22003. Rename
  22004. rstflock
  22005. RstFLock
  22006. SetEOF
  22007. SetFInfo
  22008. setfinfo
  22009. setflock
  22010. SetFLock
  22011. SetFPos
  22012. SetVol
  22013. setvol
  22014. unmountvol
  22015. UnmountVol
  22016.  
  22017. AccessParam
  22018. alphaStage
  22019. AltAccessParam
  22020. AltAccessParamPtr
  22021. betaStage
  22022. CatPositionRec
  22023. CInfoPBPtr
  22024. CInfoPBRec
  22025. CInfoType
  22026. CMovePBPtr
  22027. CMovePBRec
  22028. CntrlParam
  22029. CopyParam
  22030. CSParam
  22031. CSParamPtr
  22032. developStage
  22033. DInfo
  22034. DirInfo
  22035. dirInfo
  22036. DrvQEl
  22037. DrvQElPtr
  22038. DTPBPtr
  22039. DTPBRec
  22040. DXInfo
  22041. FCBPBPtr
  22042. FCBPBRec
  22043. fDesktop
  22044. fDisk
  22045. fHasBundle
  22046. FIDParam
  22047. FileParam
  22048. finalStage
  22049. FInfo
  22050. fInvisible
  22051. fOnDesk
  22052. fsAtMark
  22053. fsCurPerm
  22054. fsFromLEOF
  22055. fsFromMark
  22056. fsFromStart
  22057. fsRdPerm
  22058. fsRdWrPerm
  22059. fsRdWrShPerm
  22060. fsRtDirID
  22061. fsRtParID
  22062. fsSBDrBkDat
  22063. fsSBDrCrDat
  22064. fsSBDrFndrInfo
  22065. fsSBDrMdDat
  22066. fsSBDrNmFls
  22067. fsSBDrParID
  22068. fsSBDrUsrWds
  22069. fsSBFlAttrib
  22070. fsSBFlBkDat
  22071. fsSBFlCrDat
  22072. fsSBFlFndrInfo
  22073. fsSBFlLgLen
  22074. fsSBFlMdDat
  22075. fsSBFlParID
  22076. fsSBFlPyLen
  22077. fsSBFlRLgLen
  22078. fsSBFlRPyLen
  22079. fsSBFlXFndrInfo
  22080. fsSBFullName
  22081. fsSBNegate
  22082. fsSBPartialName
  22083. FSSpec
  22084. FSSpecHandle
  22085. FSSpecPtr
  22086. fsWrPerm
  22087. fTrash
  22088. FXInfo
  22089. HFileInfo
  22090. hFileInfo
  22091. HFileParam
  22092. HIOParam
  22093. HParamBlockRec
  22094. HParmBlkPtr
  22095. HVolumeParam
  22096. ioDirFlg
  22097. ioDirMask
  22098. IOParam
  22099. MultiDevParam
  22100. NumVersion
  22101. ObjParam
  22102. ParamBlockHeader
  22103. ParamBlockRec
  22104. ParmBlkPtr
  22105. rdVerify
  22106. SlotDevParam
  22107. VCB
  22108. VersRec
  22109. VersRecHndl
  22110. VersRecPtr
  22111. VolumeParam
  22112. WDParam
  22113. WDPBPtr
  22114. WDPBRec
  22115.  
  22116. æKY fsAtMark
  22117. æFc Files.h
  22118. æT #define
  22119. æD 
  22120. /* Finder Constants */
  22121.  
  22122. #define fsAtMark 0
  22123. æC 
  22124. IOPosMode and ioPosOffset specify the position of the mark for Read, Write, LockRng,
  22125. UnlockRng, and SetFPos calls. IOPosMode contains the positioning mode; bits 0 and 1
  22126. indicate how to position the mark, and you can use the following predefined constants
  22127. to set or test their value:
  22128.  
  22129. #define  fsAtMark     0    /*at current mark*/
  22130. #define  fsFromStart  1    /*set mark relative to beginning of file*/
  22131. #define  fsFromLEOF   2    /*set mark relative to logical end-of-file*/
  22132. #define  fsFromMark   3    /*set mark relative to current mark*/
  22133.  
  22134. If you specify fsAtMark, ioPosOffset is ignored and the operation begins wherever the
  22135. mark is currently positioned. If you choose to set the mark
  22136. (relative to either the beginning of the file, the logical end-of-file, or the current
  22137. mark), ioPosOffset must specify the byte offset from the chosen point
  22138. (either positive or negative) where the operation should begin.
  22139.  
  22140. Note:  Advanced programmers:  Bit 7 of ioPosMode is the newline flag; it’s
  22141.        set if read operations should terminate at a newline character. The
  22142.        ASCII code of the newline character is specified in the high-order
  22143.        byte of ioPosMode. If the newline flag is set, the data will be read
  22144.        one byte at a time until the newline character is encountered,
  22145.        ioReqCount bytes have been read, or the end-of-file is reached. If
  22146.        the newline flag is clear, the data will be read one byte at a time
  22147.        until ioReqCount bytes have been read or the end-of-file is reached.
  22148.  
  22149. æKY fOnDesk
  22150. æFc Files.h
  22151. æT #define
  22152. æD #define fOnDesk 1
  22153. æC 
  22154.  
  22155. æKY fsCurPerm
  22156. æFc Files.h
  22157. æT #define
  22158. æD #define fsCurPerm 0
  22159. æC 
  22160. IOPermssn requests permission to read or write via an access path, and must contain
  22161. one of the following values:
  22162.  
  22163. #define  fsCurPerm      0    /*whatever is currently allowed*/
  22164. #define  fsRdPerm       1    /*request for read permission only*/
  22165. #define  fsWrPerm       2    /*request for write permission*/
  22166. #define  fsRdWrPerm     3    /*request for exclusive read/write permission*/
  22167. #define  fsRdWrShPerm   4    /*request for shared read/write permission*/
  22168.  
  22169. This request is compared with the open permission of the file. If the open permission
  22170. doesn’t allow I/O as requested, a result code indicating the error is returned.
  22171.  
  22172. Warning:  To ensure data integrity be sure to lock the portion of the
  22173.           file you’ll be using if you specify shared write permission.
  22174.  
  22175. æKY fHasBundle
  22176. æFc Files.h
  22177. æT #define
  22178. æD #define fHasBundle 8192
  22179. æC 
  22180.  
  22181. æKY fsRdPerm
  22182. æFc Files.h
  22183. æT #define
  22184. æD #define fsRdPerm 1
  22185. æC 
  22186.  
  22187. æKY fInvisible
  22188. æFc Files.h
  22189. æT #define
  22190. æD #define fInvisible 16384
  22191. æC 
  22192.  
  22193. æKY fTrash
  22194. æFc Files.h
  22195. æT #define
  22196. æD #define fTrash -3
  22197. æC 
  22198.  
  22199. æKY fsWrPerm
  22200. æFc Files.h
  22201. æT #define
  22202. æD #define fsWrPerm 2
  22203. æC 
  22204.  
  22205. æKY fDesktop
  22206. æFc Files.h
  22207. æT #define
  22208. æD #define fDesktop -2
  22209. æC 
  22210.  
  22211. æKY fsRdWrPerm
  22212. æFc Files.h
  22213. æT #define
  22214. æD #define fsRdWrPerm 3
  22215. æC 
  22216.  
  22217. æKY fDisk
  22218. æFc Files.h
  22219. æT #define
  22220. æD #define fDisk 0
  22221. æC 
  22222.  
  22223. æKY fsRdWrShPerm
  22224. æFc Files.h
  22225. æT #define
  22226. æD #define fsRdWrShPerm 4
  22227. æC 
  22228.  
  22229. æKY fsFromStart
  22230. æFc Files.h
  22231. æT #define
  22232. æD #define fsFromStart 1
  22233. æC 
  22234.  
  22235. æKY fsFromLEOF
  22236. æFc Files.h
  22237. æT #define
  22238. æD #define fsFromLEOF 2
  22239. æC 
  22240.  
  22241. æKY fsFromMark
  22242. æFc Files.h
  22243. æT #define
  22244. æD #define fsFromMark 3
  22245. æC 
  22246.  
  22247. æKY rdVerify
  22248. æFc Files.h
  22249. æT #define
  22250. æD #define rdVerify 64
  22251. æC To have the File Manager verify that all data written to a volume exactly matches the
  22252. data in memory, make a Read call right after the Write call. The parameters for a
  22253. read-verify operation are the same as for a standard Read call, except that the
  22254. following constant must be added to the positioning mode:
  22255.  
  22256. #define rdVerify 64    /*read-verify mode*/
  22257.  
  22258. The result code ioErr is returned if any of the data doesn’t match.
  22259.  
  22260. æKY ioDirFlg
  22261. æFc Files.h
  22262. æT #define
  22263. æD #define ioDirFlg 3
  22264. æC 
  22265.  
  22266. æKY ioDirMask
  22267. æFc Files.h
  22268. æT #define
  22269. æD #define ioDirMask 0x10
  22270. æC 
  22271.  
  22272. æKY fsRtParID
  22273. æFc Files.h
  22274. æT #define
  22275. æD #define fsRtParID 1
  22276. æC 
  22277.  
  22278. æKY fsRtDirID
  22279. æFc Files.h
  22280. æT #define
  22281. æD #define fsRtDirID 2
  22282. æC 
  22283.  
  22284. æKY fsSBNegate
  22285. æFc Files.h
  22286. æT #define
  22287. æD #define fsSBNegate 16384
  22288. æC 
  22289.  
  22290. æKY fsSBPartialName
  22291. æFc Files.h
  22292. æT #define
  22293. æD 
  22294. /*  masks for SpecBits values  */
  22295.  
  22296. #define fsSBPartialName 1
  22297. æC 
  22298.  
  22299. æKY fsSBFullName
  22300. æFc Files.h
  22301. æT #define
  22302. æD #define fsSBFullName 2
  22303. æC 
  22304.  
  22305. æKY fsSBFlAttrib
  22306. æFc Files.h
  22307. æT #define
  22308. æD #define fsSBFlAttrib 4
  22309. æC 
  22310.  
  22311. æKY fsSBFlFndrInfo
  22312. æFc Files.h
  22313. æT #define
  22314. æD #define fsSBFlFndrInfo 8
  22315. æC 
  22316.  
  22317. æKY fsSBFlLgLen
  22318. æFc Files.h
  22319. æT #define
  22320. æD #define fsSBFlLgLen 32
  22321. æC 
  22322.  
  22323. æKY fsSBFlPyLen
  22324. æFc Files.h
  22325. æT #define
  22326. æD #define fsSBFlPyLen 64
  22327. æC 
  22328.  
  22329. æKY fsSBFlRLgLen
  22330. æFc Files.h
  22331. æT #define
  22332. æD #define fsSBFlRLgLen 128
  22333. æC 
  22334.  
  22335. æKY fsSBFlRPyLen
  22336. æFc Files.h
  22337. æT #define
  22338. æD #define fsSBFlRPyLen 256
  22339. æC 
  22340.  
  22341. æKY fsSBFlCrDat
  22342. æFc Files.h
  22343. æT #define
  22344. æD #define fsSBFlCrDat 512
  22345. æC 
  22346.  
  22347. æKY fsSBFlMdDat
  22348. æFc Files.h
  22349. æT #define
  22350. æD #define fsSBFlMdDat 1024
  22351. æC 
  22352.  
  22353. æKY fsSBFlBkDat
  22354. æFc Files.h
  22355. æT #define
  22356. æD #define fsSBFlBkDat 2048
  22357. æC 
  22358.  
  22359. æKY fsSBFlXFndrInfo
  22360. æFc Files.h
  22361. æT #define
  22362. æD #define fsSBFlXFndrInfo 4096
  22363. æC 
  22364.  
  22365. æKY fsSBFlParID
  22366. æFc Files.h
  22367. æT #define
  22368. æD #define fsSBFlParID 8192
  22369. æC 
  22370.  
  22371. æKY fsSBDrUsrWds
  22372. æFc Files.h
  22373. æT #define
  22374. æD #define fsSBDrUsrWds 8
  22375. æC 
  22376.  
  22377. æKY fsSBDrNmFls
  22378. æFc Files.h
  22379. æT #define
  22380. æD #define fsSBDrNmFls 16
  22381. æC 
  22382.  
  22383. æKY fsSBDrCrDat
  22384. æFc Files.h
  22385. æT #define
  22386. æD #define fsSBDrCrDat 512
  22387. æC 
  22388.  
  22389. æKY fsSBDrMdDat
  22390. æFc Files.h
  22391. æT #define
  22392. æD #define fsSBDrMdDat 1024
  22393. æC 
  22394.  
  22395. æKY fsSBDrBkDat
  22396. æFc Files.h
  22397. æT #define
  22398. æD #define fsSBDrBkDat 2048
  22399. æC 
  22400.  
  22401. æKY fsSBDrFndrInfo
  22402. æFc Files.h
  22403. æT #define
  22404. æD #define fsSBDrFndrInfo 4096
  22405. æC 
  22406.  
  22407. æKY fsSBDrParID
  22408. æFc Files.h
  22409. æT #define
  22410. æD #define fsSBDrParID 8192
  22411. æC 
  22412.  
  22413. æKY developStage
  22414. æFc Files.h
  22415. æT #define
  22416. æD 
  22417. /* Version Release Stage Codes */
  22418.  
  22419. #define developStage 0x20
  22420. æC 
  22421.  
  22422. æKY alphaStage
  22423. æFc Files.h
  22424. æT #define
  22425. æD #define alphaStage 0x40
  22426. æC 
  22427.  
  22428. æKY betaStage
  22429. æFc Files.h
  22430. æT #define
  22431. æD #define betaStage 0x60
  22432. æC 
  22433.  
  22434. æKY finalStage
  22435. æFc Files.h
  22436. æT #define
  22437. æD #define finalStage 0x80
  22438. æC 
  22439.  
  22440. æKY CInfoType
  22441. hFileInfo
  22442. dirInfo
  22443. æFc Files.h
  22444. æT enum
  22445. æD enum {hFileInfo,dirInfo};
  22446. typedef unsigned char CInfoType;
  22447. æC 
  22448.  
  22449. æKY FInfo
  22450. æFc Files.h
  22451. æT struct
  22452. æD struct FInfo {
  22453.     OSType fdType; /*the type of the file*/
  22454.     OSType fdCreator; /*file's creator*/
  22455.     unsigned short fdFlags; /*flags ex. hasbundle,invisible,locked, etc.*/
  22456.     Point fdLocation; /*file's location in folder*/
  22457.     short fdFldr; /*folder containing file*/
  22458. };
  22459.  
  22460. typedef struct FInfo FInfo;
  22461. æC 
  22462.  
  22463. æKY FXInfo
  22464. æFc Files.h
  22465. æT struct
  22466. æD struct FXInfo {
  22467.     short fdIconID; /*Icon ID*/
  22468.     short fdUnused[4]; /*unused but reserved 8 bytes*/
  22469.     short fdComment; /*Comment ID*/
  22470.     long fdPutAway; /*Home Dir ID*/
  22471. };
  22472.  
  22473. typedef struct FXInfo FXInfo;
  22474. æC 
  22475.  
  22476. On hierarchical volumes, in addition to the FInfo record, the following information
  22477. about files is maintained for the Finder:
  22478.  
  22479. æKY DInfo
  22480. æFc Files.h
  22481. æT struct
  22482. æD struct DInfo {
  22483.     Rect frRect; /*folder rect*/
  22484.     unsigned short frFlags; /*Flags*/
  22485.     Point frLocation; /*folder location*/
  22486.     short frView; /*folder view*/
  22487. };
  22488.  
  22489. typedef struct DInfo DInfo;
  22490. æC 
  22491.  
  22492. On hierarchical volumes, the following information about directories is maintained
  22493. for the Finder:
  22494.  
  22495. DInfo = RECORD
  22496.           frRect:      Rect;       {folder's rectangle}
  22497.           frFlags:     INTEGER;    {flags}
  22498.           frLocation:  Point;      {folder's location}
  22499.           frView:      INTEGER;    {folder's view}
  22500.         END;
  22501.  
  22502. DXInfo = RECORD
  22503.            frScroll:     Point;      {scroll position}
  22504.            frOpenChain:  LONGINT;    {directory ID chain of open folders}
  22505.            frUnused:     INTEGER;    {reserved}
  22506.            frComment:    INTEGER;    {comment ID}
  22507.            frPutAway:    LONGINT;    {directory ID}
  22508.          END;
  22509.  
  22510. When a file (or folder) is moved to the desktop on a hierarchical volume, it’s actually
  22511. moved to the root level of the file directory. (This permits all the desktop icons to
  22512. be enumerated by one simple scan of the root.) The fOnDesk bit of fdFlags is set.
  22513. FDPutAway (or frPutAway for directories) contains the directory ID of the folder that
  22514. originally contained the file (or folder); this allows the file (or folder) to be
  22515. returned there from the desktop.
  22516.  
  22517. æKY DXInfo
  22518. æFc Files.h
  22519. æT struct
  22520. æD struct DXInfo {
  22521.     Point frScroll; /*scroll position*/
  22522.     long frOpenChain; /*DirID chain of open folders*/
  22523.     short frUnused; /*unused but reserved*/
  22524.     short frComment; /*comment*/
  22525.     long frPutAway; /*DirID*/
  22526. };
  22527.  
  22528. typedef struct DXInfo DXInfo;
  22529. æC 
  22530.  
  22531. æKY ParamBlockHeader
  22532. æFc Files.h
  22533. æT struct
  22534. æD #define ParamBlockHeader \
  22535.     QElemPtr qLink; /*queue link in header*/
  22536.     short qType; /*type byte for safety check*/
  22537.     short ioTrap; /*FS: the Trap*/
  22538.     Ptr ioCmdAddr; /*FS: address to dispatch to*/
  22539.     ProcPtr ioCompletion; /*completion routine addr (0 for synch calls)*/
  22540.     OSErr ioResult; /*result code*/
  22541.     StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
  22542.     short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
  22543.  
  22544.  
  22545. æC 
  22546.  
  22547. æKY IOParam
  22548. æFc Files.h
  22549. æT struct
  22550. æD struct IOParam {
  22551.     ParamBlockHeader 
  22552.     short ioRefNum; /*refNum for I/O operation*/
  22553.     char ioVersNum; /*version number*/
  22554.     char ioPermssn; /*Open: permissions (byte)*/
  22555.     Ptr ioMisc; /*Rename: new name (GetEOF,SetEOF: logical end of file) (Open: optional ptr to buffer) (SetFileType: new type)*/
  22556.     Ptr ioBuffer; /*data buffer Ptr*/
  22557.     long ioReqCount; /*requested byte count; also = ioNewDirID*/
  22558.     long ioActCount; /*actual byte count completed*/
  22559.     short ioPosMode; /*initial file positioning*/
  22560.     long ioPosOffset; /*file position offset*/
  22561. };
  22562.  
  22563. typedef struct IOParam IOParam;
  22564. æC 
  22565.  
  22566. æKY FileParam
  22567. æFc Files.h
  22568. æT struct
  22569. æD struct FileParam {
  22570.     ParamBlockHeader 
  22571.     short ioFRefNum; /*reference number*/
  22572.     char ioFVersNum; /*version number*/
  22573.     char filler1;
  22574.     short ioFDirIndex; /*GetFInfo directory index*/
  22575.     unsigned char ioFlAttrib; /*GetFInfo: in-use bit=7, lock bit=0*/
  22576.     unsigned char ioFlVersNum; /*file version number*/
  22577.     FInfo ioFlFndrInfo; /*user info*/
  22578.     unsigned long ioFlNum; /*GetFInfo: file number; TF- ioDirID*/
  22579.     unsigned short ioFlStBlk; /*start file block (0 if none)*/
  22580.     long ioFlLgLen; /*logical length (EOF)*/
  22581.     long ioFlPyLen; /*physical length*/
  22582.     unsigned short ioFlRStBlk; /*start block rsrc fork*/
  22583.     long ioFlRLgLen; /*file logical length rsrc fork*/
  22584.     long ioFlRPyLen; /*file physical length rsrc fork*/
  22585.     unsigned long ioFlCrDat; /*file creation date& time (32 bits in secs)*/
  22586.     unsigned long ioFlMdDat; /*last modified date and time*/
  22587. };
  22588.  
  22589. typedef struct FileParam FileParam;
  22590. æC 
  22591.  
  22592. æKY VolumeParam
  22593. æFc Files.h
  22594. æT struct
  22595. æD struct VolumeParam {
  22596.     ParamBlockHeader 
  22597.     long filler2;
  22598.     short ioVolIndex; /*volume index number*/
  22599.     unsigned long ioVCrDate; /*creation date and time*/
  22600.     unsigned long ioVLsBkUp; /*last backup date and time*/
  22601.     unsigned short ioVAtrb; /*volume attrib*/
  22602.     unsigned short ioVNmFls; /*number of files in directory*/
  22603.     unsigned short ioVDirSt; /*start block of file directory*/
  22604.     short ioVBlLn; /*GetVolInfo: length of dir in blocks*/
  22605.     unsigned short ioVNmAlBlks; /*GetVolInfo: num blks (of alloc size)*/
  22606.     long ioVAlBlkSiz; /*GetVolInfo: alloc blk byte size*/
  22607.     long ioVClpSiz; /*GetVolInfo: bytes to allocate at a time*/
  22608.     unsigned short ioAlBlSt; /*starting disk(512-byte) block in block map*/
  22609.     unsigned long ioVNxtFNum; /*GetVolInfo: next free file number*/
  22610.     unsigned short ioVFrBlk; /*GetVolInfo: # free alloc blks for this vol*/
  22611. };
  22612.  
  22613. typedef struct VolumeParam VolumeParam;
  22614. æC 
  22615.  
  22616. æKY CntrlParam
  22617. æFc Files.h
  22618. æT struct
  22619. æD struct CntrlParam {
  22620.     QElem *qLink; /*queue link in header*/
  22621.     short qType; /*type byte for safety check*/
  22622.     short ioTrap; /*FS: the Trap*/
  22623.     Ptr ioCmdAddr; /*FS: address to dispatch to*/
  22624.     ProcPtr ioCompletion; /*completion routine addr (0 for synch calls)*/
  22625.     OSErr ioResult; /*result code*/
  22626.     StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
  22627.     short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
  22628.     short ioCRefNum; /*refNum for I/O operation*/
  22629.     short csCode; /*word for control status code*/
  22630.     short csParam[11]; /*operation-defined parameters*/
  22631. };
  22632.  
  22633. typedef struct CntrlParam CntrlParam;
  22634. æC 
  22635.  
  22636. æKY SlotDevParam
  22637. æFc Files.h
  22638. æT struct
  22639. æD struct SlotDevParam {
  22640.     ParamBlockHeader 
  22641.     short ioRefNum;
  22642.     char ioVersNum;
  22643.     char ioPermssn;
  22644.     Ptr ioMix;
  22645.     short ioFlags;
  22646.     char ioSlot;
  22647.     char ioID;
  22648. };
  22649.  
  22650. typedef struct SlotDevParam SlotDevParam;
  22651. æC 
  22652.  
  22653. æKY MultiDevParam
  22654. æFc Files.h
  22655. æT struct
  22656. æD struct MultiDevParam {
  22657.     ParamBlockHeader 
  22658.     short ioRefNum;
  22659.     char ioVersNum;
  22660.     char ioPermssn;
  22661.     Ptr ioMix;
  22662.     short ioFlags;
  22663.     Ptr ioSEBlkPtr;
  22664. };
  22665.  
  22666. typedef struct MultiDevParam MultiDevParam;
  22667. æC 
  22668.  
  22669. æKY ParamBlockRec
  22670. ParmBlkPtr
  22671. æFc Files.h
  22672. æT struct
  22673. æD union ParamBlockRec {
  22674.     IOParam ioParam;
  22675.     FileParam fileParam;
  22676.     VolumeParam volumeParam;
  22677.     CntrlParam cntrlParam;
  22678.     SlotDevParam slotDevParam;
  22679.     MultiDevParam multiDevParam;
  22680. };
  22681.  
  22682. typedef union ParamBlockRec ParamBlockRec;
  22683.  
  22684. typedef ParamBlockRec *ParmBlkPtr;
  22685.  
  22686. æC »FileParam Variant ( ParamBlockRec and HParamBlockRec)
  22687.  
  22688. The fileParam variants of ParamBlockRec and HParamBlockRec are identical, with one
  22689. exception:  The field ioDirID in HParamBlockRec is called ioFlNum in ParamBlockRec.
  22690. The fields of the fileParam variant of HParamBlockRec are as follows:  
  22691.  
  22692. •••Refer to Technical Note #204:•••
  22693.  
  22694.   fileParam:
  22695.    (ioFRefNum:     INTEGER;     {path reference number}
  22696.     ioFVersNum:    SignedByte;  {version number}
  22697.     filler1:       SignedByte;  {not used}
  22698.     ioFDirIndex:   INTEGER;     {index}
  22699.     ioFlAttrib:    SignedByte;  {file attributes}
  22700.     ioFlVersNum:   SignedByte;  {version number}
  22701.     ioFlFndrInfo:  FInfo;       {information used by the Finder}
  22702.     ioDirID:       LONGINT;     {directory ID or file number}
  22703.     ioFlStBlk:     INTEGER;     {first allocation block of data fork}
  22704.     ioFlLgLen:     LONGINT;     {logical end-of-file of data fork}
  22705.     ioFlPyLen:     LONGINT;     {physical end-of-file of data fork}
  22706.     ioFlRStBlk:    INTEGER;     {first allocation block of resource fork}
  22707.     ioFlRLgLen:    LONGINT;     {logical end-of-file of resource fork}
  22708.     ioFlRPyLen:    LONGINT;     {physical end-of-file of resource fork}
  22709.     ioFlCrDat:     LONGINT;     {date and time of creation}
  22710.     ioFlMdDat:     LONGINT);    {date and time of last modification}
  22711.  
  22712. IOFDirIndex can be used with the PBGetFInfo and PBHGetFInfo to index through the
  22713. files in a given directory.
  22714.  
  22715. Warning:  When used with GetFileInfo, ioFDirIndex will index only the files
  22716.           in a directory. To index both files and directories, you can use
  22717.           ioFDirIndex with PBGetCatInfo.
  22718.  
  22719. IOFlAttrib contains the following file attributes:
  22720.  
  22721.   Bit    Meaning
  22722.  
  22723.    0     Set if file is locked
  22724.    2     Set if resource fork is open
  22725.    3     Set if data fork is open
  22726.    4     Set if a directory
  22727.    7     Set if file (either fork) is open
  22728.  
  22729. When passed to a routine, ioDirID contains a directory ID; it can be used to refer to
  22730. a directory or, in conjuction with a partial pathname from that directory, to other
  22731. files and directories. If both a directory ID and a working directory reference
  22732. number are provided, the directory ID is used to identify the directory on the volume
  22733. indicated by the working directory reference number. In other words, a directory ID
  22734. specified by the caller will override the working directory referred to by the working
  22735. directory reference number. If you don’t want this to happen, you can set ioDirID to
  22736. 0. (If no directory is specified through a working directory reference number, the
  22737. root directory ID will be used.)
  22738.  
  22739. When returned from a routine, ioDirID contains the file number of a file; most programmers
  22740. needn’t be concerned with file numbers, but those interested can read the section
  22741. “Data Organization on Volumes”.
  22742.  
  22743. IOFlStBlk and ioFlRStBlk contain 0 if the file’s data or resource fork is empty,
  22744. respectively; they’re used only with flat volumes. The date and time in the ioFlCrDat
  22745. and ioFlMdDat fields are specified in seconds since midnight,
  22746. January 1, 1904.
  22747.  
  22748. »VolumeParam Variant (ParamBlockRec)
  22749.  
  22750. When you call GetVolInfo, you’ll use the volumeParam variant of ParamBlockRec:
  22751.  
  22752.   volumeParam:
  22753.    (filler2:      LONGINT;    {not used}
  22754.     ioVolIndex:   INTEGER;    {index}
  22755.     ioVCrDate:    LONGINT;    {date and time of initialization}
  22756.     ioVLsBkUp:    LONGINT;    {date and time of last modification}
  22757.     ioVAtrb:      INTEGER;    {volume attributes}
  22758.     ioVNmFls:     INTEGER;    {number of files in root directory}
  22759.     ioVDirSt:     INTEGER;    {first block of directory}
  22760.     ioVBlLn:      INTEGER;    {length of directory in blocks}
  22761.     ioVNmAlBlks:  INTEGER;    {number of allocation blocks}
  22762.     ioVAlBlkSiz:  LONGINT;    {size of allocation blocks}
  22763.     ioVClpSiz:    LONGINT;    {number of bytes to allocate}
  22764.     ioAlBlSt:     INTEGER;    {first block in volume block map}
  22765.     ioVNxtFNum:   LONGINT;    {next unused file number}
  22766.     ioVFrBlk:     INTEGER);   {number of unused allocation blocks}
  22767.  
  22768. IOVolIndex can be used to index through all the mounted volumes; using an index of 1
  22769. accesses the first volume mounted, and so on. (For more information on indexing, see
  22770. the section “Indexing” above.)
  22771.  
  22772. IOVLsBkUp contains the date and time the volume information was last modified
  22773. (this is not necessarily when it was flushed). (This field is not modified when
  22774. information is written to a file.)
  22775.  
  22776. Note:  The name ioVLsBkUp is actually a misnomer; this field has always
  22777.        contained the date and time of the last modification to the volume,
  22778.        not the last backup.
  22779.  
  22780. Most programmers needn’t be concerned with the remaining parameters, but interested
  22781. programmers can read the section “Data Organization on Volumes”.
  22782.  
  22783. »VolumeParam Variant (HParamBlockRec)
  22784.  
  22785. When you call HGetVInfo and SetVolInfo, you’ll use the volumeParam variant of HParamBlockRec.
  22786. This is a superset of the volumeParam variant of ParamBlockRec; the names and functions
  22787. of certain fields have been changed, and new fields have been added:
  22788.  
  22789.   volumeParam:
  22790.    (filler2:      LONGINT;    {not used}
  22791.     ioVolIndex:   INTEGER;    {index}
  22792.     ioVCrDate:    LONGINT;    {date and time of initialization}
  22793.     ioVLsMod:     LONGINT;    {date and time of last modification}
  22794.     ioVAtrb:      INTEGER;    {volume attributes}
  22795.     ioVNmFls:     INTEGER;    {number of files in root directory}
  22796.     ioVBitMap:    INTEGER;    {first block of volume bit map}
  22797.     ioAllocPtr:   INTEGER;    {block at which next new file starts}
  22798.     ioVNmAlBlks:  INTEGER;    {number of allocation blocks}
  22799.     ioVAlBlkSiz:  LONGINT;    {size of allocation blocks}
  22800.     ioVClpSiz:    LONGINT;    {number of bytes to allocate}
  22801.     ioAlBlSt:     INTEGER;    {first block in volume block map}
  22802.     ioVNxtCNID:   LONGINT;    {next unused file number}
  22803.     ioVFrBlk:     INTEGER;    {number of unused allocation blocks}
  22804.     ioVSigWord:   INTEGER;    {volume signature}
  22805.     ioVDrvInfo:   INTEGER;    {drive number}
  22806.     ioVDRefNum:   INTEGER;    {driver reference number}
  22807.     ioVFSID:      INTEGER;    {file system handling this volume}
  22808.     ioVBkUp:      LONGINT;    {date and time of last backup}
  22809.     ioVSeqNum:    INTEGER;    {used internally}
  22810.     ioVWrCnt      LONGINT;    {volume write count}
  22811.     ioVFilCnt:    LONGINT;    {number of files on volume}
  22812.     ioVDirCnt:    LONGINT;    {number of directories on volume}
  22813.     ioVFndrInfo:  ARRAY[1..8] OF LONGINT); {information used by the Finder}
  22814.  
  22815. IOVolIndex can be used to index through all the mounted volumes; using an index of 1
  22816. accesses the first volume mounted, and so on. (For more information on indexing, see
  22817. the section “Indexing” above.)
  22818.  
  22819. IOVLsMod contains the date and time the volume information was last modified
  22820. (this is not necessarily when it was flushed). (This field is not modified when
  22821. information is written to a file.)
  22822.  
  22823. Note:  IOVLsMod replaces the field ioVLsBkUp in ParamBlockRec. The name
  22824.        ioVLsBkUp was actually a misnomer; this field has always contained
  22825.        the date and time of the last modification, not the last backup.
  22826.        Another field, ioVBkUp, contains the date and time of the last backup.
  22827.  
  22828. IOVClpSiz can be used to set the volume clump size in bytes; it’s used for files that
  22829. don’t have a clump size defined as part of their file information in the catalog. To
  22830. promote file contiguity and avoid fragmentation, space is allocated to a file not in
  22831. allocation blocks but in clumps. A clump is a group of contiguous allocation blocks.
  22832. The clump size is always a multiple of the allocation block size; it’s the minimum
  22833. number of bytes to allocate each time the Allocate function is called or the end-of-file
  22834. is reached during the Write routine.
  22835.  
  22836. IOVSigWord contains a signature word identifying the type of volume; it’s $D2D7 for
  22837. flat directory volumes and $4244 for hierarchical directory volumes. The drive number
  22838. of the drive containing the volume is returned in ioDrvInfo. For on-line volumes,
  22839. ioVDRefNum returns the reference number of the I/O driver for the drive identified by
  22840. ioDrvInfo.
  22841.  
  22842. IOVFSID is the file-system identifier. It indicates which file system is servicing
  22843. the volume; it’s 0 for File Manager volumes and nonzero for volumes handled by an
  22844. external file system.
  22845.  
  22846. IOVBkUp specifies the date and time the volume was last backed up (it’s 0 if never
  22847. backed up).
  22848.  
  22849. IOVNmFls contains the number of files in the root directory. IOVFilCnt contains the
  22850. total number of files on the volume, while ioVDirCnt contains the total number of
  22851. directories (not including the root directory).
  22852.  
  22853. Most programmers needn’t be concerned with the other parameters, but interested
  22854. programmers can read the section “Data Organization on Volumes”.
  22855.  
  22856. HParamBlockRec, described above, has been extended to support a shared environment
  22857. with the addition of AccessParam, ObjParam, CopyParam, and
  22858. WDParam, as shown below.  (The complete HParamBlockRec data type is shown in the
  22859. summary.)
  22860.  
  22861.   AccessParam:
  22862.    (filler3:       INTEGER;
  22863.     ioDenyModes:   INTEGER;      {access rights data}
  22864.     filler4:       INTEGER;
  22865.     filler5:       Signed Byte;
  22866.     ioACUser:      Signed Byte;  {access rights for directory only}
  22867.     filler6:       LONGINT;
  22868.     ioACOwnerID:   LONGINT;      {owner ID}
  22869.     ioACGroupID:   LONGINT;      {group ID}
  22870.     ioACAccess:    LONGINT);     {access rights}
  22871.  
  22872.   ObjParam:
  22873.    (filler7:       INTEGER;
  22874.     ioObjType:     INTEGER;   {function code}
  22875.     ioObjNamePtr:  Ptr;       {ptr to returned creator/group name}
  22876.     ioObjID:       LONGINT;   {creator/group ID}
  22877.     ioReqCount:    LONGINT;   {size of buffer area}
  22878.     ioActCount:    LONGINT);  {length of vol parms data}
  22879.  
  22880.   CopyParam:
  22881.    (ioDstVRefNum:  INTEGER;   {destination vol identifier}
  22882.     filler8:       INTEGER;
  22883.     ioNewName:     Ptr;       {ptr to destination pathname}
  22884.     ioCopyName:    Ptr;       {ptr to optional name}
  22885.     ioNewDirID:    LONGINT);  {destination directory ID}
  22886.  
  22887.   WDParam:
  22888.    (filler9:       INTEGER;
  22889.     ioWDIndex:     INTEGER;
  22890.     ioWDProcID:    LONGINT;
  22891.     ioWDVRefNum:   INTEGER;
  22892.     filler10:      INTEGER;
  22893.     filler11:      LONGINT;
  22894.     filler12:      LONGINT;
  22895.     filler13:      LONGINT;
  22896.     ioWDDirID:     LONGINT);
  22897.  
  22898. æKY HFileInfo
  22899. æFc Files.h
  22900. æT struct
  22901. æD struct HFileInfo {
  22902.     ParamBlockHeader 
  22903.     short ioFRefNum;
  22904.     char ioFVersNum;
  22905.     char filler1;
  22906.     short ioFDirIndex;
  22907.     char ioFlAttrib;
  22908.     char filler2;
  22909.     FInfo ioFlFndrInfo;
  22910.     long ioDirID;
  22911.     unsigned short ioFlStBlk;
  22912.     long ioFlLgLen;
  22913.     long ioFlPyLen;
  22914.     unsigned short ioFlRStBlk;
  22915.     long ioFlRLgLen;
  22916.     long ioFlRPyLen;
  22917.     unsigned long ioFlCrDat;
  22918.     unsigned long ioFlMdDat;
  22919.     unsigned long ioFlBkDat;
  22920.     FXInfo ioFlXFndrInfo;
  22921.     long ioFlParID;
  22922.     long ioFlClpSiz;
  22923. };
  22924.  
  22925. typedef struct HFileInfo HFileInfo;
  22926. æC 
  22927.  
  22928. æKY DirInfo
  22929. æFc Files.h
  22930. æT struct
  22931. æD struct DirInfo {
  22932.     ParamBlockHeader 
  22933.     short ioFRefNum;
  22934.     short filler1;
  22935.     short ioFDirIndex;
  22936.     char ioFlAttrib;
  22937.     char filler2;
  22938.     DInfo ioDrUsrWds;
  22939.     long ioDrDirID;
  22940.     unsigned short ioDrNmFls;
  22941.     short filler3[9];
  22942.     unsigned long ioDrCrDat;
  22943.     unsigned long ioDrMdDat;
  22944.     unsigned long ioDrBkDat;
  22945.     DXInfo ioDrFndrInfo;
  22946.     long ioDrParID;
  22947. };
  22948.  
  22949. typedef struct DirInfo DirInfo;
  22950. æC 
  22951.  
  22952. æKY CInfoPBRec
  22953. CInfoPBPtr
  22954. æFc Files.h
  22955. æT struct
  22956. æD union CInfoPBRec {
  22957.     HFileInfo hFileInfo;
  22958.     DirInfo dirInfo;
  22959. };
  22960.  
  22961. typedef union CInfoPBRec CInfoPBRec;
  22962.  
  22963. typedef CInfoPBRec *CInfoPBPtr;
  22964.  
  22965. æC 
  22966. »CInfoPBRec
  22967.  
  22968. The routines GetCatInfo and SetCatInfo are used for getting and setting information
  22969. about the files and directories within a directory. With files,
  22970. you’ll use the following 19 additional fields after the standard eight fields in the
  22971. parameter block record CInfoPBRec:
  22972.  
  22973.     ioFRefNum:      INTEGER;     {path reference number}
  22974.     ioFVersNum:     SignedByte;  {version number}
  22975.     filler1:        SignedByte;  {not used}
  22976.     ioFDirIndex:    INTEGER;     {index}
  22977.     ioFlAttrib:     SignedByte;  {file attributes}
  22978.     filler2:        SignedByte;  {not used}
  22979.   hFileInfo:
  22980.    (ioFlFndrInfo:   FInfo;       {information used by the Finder}
  22981.     ioDirID:        LONGINT;     {directory ID or file number}
  22982.     ioFlStBlk:      INTEGER;     {first allocation block of data fork}
  22983.     ioFlLgLen:      LONGINT;     {logical end-of-file of data fork}
  22984.     ioFlPyLen:      LONGINT;     {physical end-of-file of data fork}
  22985.     ioFlRStBlk:     INTEGER;     {first allocation block of resource fork}
  22986.     ioFlRLgLen:     LONGINT;     {logical end-of-file of resource fork}
  22987.     ioFlRPyLen:     LONGINT;     {physical end-of-file of resource fork}
  22988.     ioFlCrDat:      LONGINT;     {date and time of creation}
  22989.     ioFlMdDat:      LONGINT;     {date and time of last modification}
  22990.     ioFlBkDat:      LONGINT;     {date and time of last backup}
  22991.     ioFlXFndrInfo:  FXInfo;      {additional information used by the Finder}
  22992.     ioFlParID:      LONGINT;     {file's parent directory ID (integer)}
  22993.     ioFlClpSiz:     LONGINT);    {file's clump size}
  22994.  
  22995. •••Refer to Technical Note #69:•••
  22996.  
  22997. IOFDirIndex can be used with the function PBGetCatInfo to index through the files and
  22998. directories in a given directory. For each iteration of the function, you can determine
  22999. whether it’s a file or a directory by testing bit 4 (the fifth least significant bit)
  23000. of ioFlAttrib. You can test for a directory by using the Toolbox Utilities BitTst
  23001. function in the following manner (remember, the Toolbox Utilities routines reverse
  23002. the standard 68000 notation):
  23003.  
  23004.   BitTst(@myCInfoRec.ioFlAttrib,3)
  23005.  
  23006. IOFlAttrib contains the following attributes:
  23007.  
  23008.   Bit    Meaning
  23009.  
  23010.    0     Set if file is locked
  23011.    2     Set if resource fork is open
  23012.    3     Set if data fork is open
  23013.    4     Set if a directory
  23014.    7     Set if file (either fork) is open
  23015.  
  23016. When passed to a routine, ioDirID contains a directory ID; it can be used to refer to
  23017. a directory or, in conjuction with a partial pathname from that directory, to other
  23018. files and directories. If both a directory ID and a working directory reference
  23019. number are provided, the directory ID is used to identify the directory on the volume
  23020. indicated by the working directory reference number. In other words, a directory ID
  23021. specified by the caller will override the working directory referred to by the working
  23022. directory reference number. If you don’t want this to happen, you can set ioDirID to
  23023. 0. (If no directory is specified through a working directory reference number, the
  23024. root directory ID will be used.)
  23025.  
  23026. Warning:  With files, ioDirID returns the file number of the file; when
  23027.           indexing with GetCatInfo, you’ll need to reset this field for
  23028.           each iteration.
  23029.  
  23030. IOFlStBlk and ioFlRStBlk contain 0 if the file’s data or resource fork is empty,
  23031. respectively; they’re used only with flat volumes. The date and time in the ioFlCrDat,
  23032. ioFlMdDat, and ioFlBkDat fields are specified in seconds since midnight, January 1,
  23033. 1904.
  23034.  
  23035. IOFlParID contains the directory ID of the file’s parent. IOFlClpSiz is the clump
  23036. size to be used when writing the file; if it’s 0, the volume’s clump size is used
  23037. when the file is opened.
  23038.  
  23039. With directories, you’ll use the following 14 additional fields after the standard
  23040. eight fields in the parameter block record CInfoPBRec:
  23041.  
  23042.     ioFRefNum:     INTEGER;     {file reference number}
  23043.     ioFVersNum     SignedByte;  {version number}
  23044.     filler1:       SignedByte;  {not used}
  23045.     ioFDirIndex:   INTEGER;     {index}
  23046.     ioFlAttrib:    SignedByte;  {file attributes}
  23047.     filler2:       SignedByte;  {not used}
  23048.   dirInfo:
  23049.    (ioDrUsrWds:    DInfo;       {information used by the Finder}
  23050.     ioDrDirID:     LONGINT;     {directory ID}
  23051.     ioDrNmFls:     INTEGER;     {number of files in directory}
  23052.     filler3:       ARRAY[1..9] OF INTEGER; {not used}
  23053.     ioDrCrDat:     LONGINT;     {date and time of creation}
  23054.     ioDrMdDat:     LONGINT;     {date and time of last modification}
  23055.     ioDrBkDat:     LONGINT;     {date and time of last backup}
  23056.     ioDrFndrInfo:  DXInfo;      {additional information used by the Finder}
  23057.     ioDrParID:     LONGINT);    {directory's parent directory ID (integer)}
  23058.  
  23059. IOFDirIndex can be used with the function PBGetCatInfo to index through the files and
  23060. directories in a given directory. For each iteration of the function, you can determine
  23061. whether it’s a file or a directory by testing bit 4 of ioFlAttrib.
  23062.  
  23063. When passed to a routine, ioDrDirID contains a directory ID; it can be used to refer
  23064. to a directory or, in conjuction with a partial pathname from that directory, to
  23065. other files and directories. If both a directory ID and a working directory reference
  23066. number are provided, the directory ID is used to identify the directory on the volume
  23067. indicated by the working directory reference number. In other words, a directory ID
  23068. specified by the caller will override the working directory referred to by the working
  23069. directory reference number. If you don’t want this to happen, you can set ioDirID to
  23070. 0. (If no directory is specified through a working directory reference number, the
  23071. root directory ID will be used.)
  23072.  
  23073. With directories, ioDrDirID returns the directory ID of the directory.
  23074.  
  23075. IODrNmFls is the number of files and directories contained in this directory
  23076. (the valence of the directory).
  23077.  
  23078. The date and time in the ioDrCrDat, ioDrMdDat, and ioDrBkDat fields are specified in
  23079. seconds since midnight, January 1, 1904.
  23080.  
  23081. IODrParID contains the directory ID of the directory’s parent.
  23082.  
  23083. æKY HIOParam
  23084. æFc Files.h
  23085. æT struct
  23086. æD struct HIOParam {
  23087.     ParamBlockHeader 
  23088.     short ioRefNum;
  23089.     char ioVersNum;
  23090.     char ioPermssn;
  23091.     Ptr ioMisc;
  23092.     Ptr ioBuffer;
  23093.     long ioReqCount;
  23094.     long ioActCount;
  23095.     short ioPosMode;
  23096.     long ioPosOffset;
  23097.     short filler1;
  23098. };
  23099.  
  23100. typedef struct HIOParam HIOParam;
  23101. æC 
  23102.  
  23103. æKY HFileParam
  23104. æFc Files.h
  23105. æT struct
  23106. æD struct HFileParam {
  23107.     ParamBlockHeader 
  23108.     short ioFRefNum;
  23109.     char ioFVersNum;
  23110.     char filler1;
  23111.     short ioFDirIndex;
  23112.     char ioFlAttrib;
  23113.     char ioFlVersNum;
  23114.     FInfo ioFlFndrInfo;
  23115.     long ioDirID;
  23116.     unsigned short ioFlStBlk;
  23117.     long ioFlLgLen;
  23118.     long ioFlPyLen;
  23119.     unsigned short ioFlRStBlk;
  23120.     long ioFlRLgLen;
  23121.     long ioFlRPyLen;
  23122.     unsigned long ioFlCrDat;
  23123.     unsigned long ioFlMdDat;
  23124. };
  23125.  
  23126. typedef struct HFileParam HFileParam;
  23127. æC 
  23128.  
  23129. æKY HVolumeParam
  23130. æFc Files.h
  23131. æT struct
  23132. æD struct HVolumeParam {
  23133.     ParamBlockHeader 
  23134.     long filler2;
  23135.     short ioVolIndex;
  23136.     unsigned long ioVCrDate;
  23137.     unsigned long ioVLsMod;
  23138.     short ioVAtrb;
  23139.     unsigned short ioVNmFls;
  23140.     short ioVBitMap;
  23141.     short ioAllocPtr;
  23142.     unsigned short ioVNmAlBlks;
  23143.     long ioVAlBlkSiz;
  23144.     long ioVClpSiz;
  23145.     short ioAlBlSt;
  23146.     long ioVNxtCNID;
  23147.     unsigned short ioVFrBlk;
  23148.     unsigned short ioVSigWord;
  23149.     short ioVDrvInfo;
  23150.     short ioVDRefNum;
  23151.     short ioVFSID;
  23152.     unsigned long ioVBkUp;
  23153.     unsigned short ioVSeqNum;
  23154.     long ioVWrCnt;
  23155.     long ioVFilCnt;
  23156.     long ioVDirCnt;
  23157.     long ioVFndrInfo[8];
  23158. };
  23159.  
  23160. typedef struct HVolumeParam HVolumeParam;
  23161. æC 
  23162.  
  23163. æKY AccessParam
  23164. æFc Files.h
  23165. æT struct
  23166. æD struct AccessParam {
  23167.     ParamBlockHeader 
  23168.     short filler3;
  23169.     short ioDenyModes; /*access rights data*/
  23170.     short filler4;
  23171.     char filler5;
  23172.     char ioACUser; /*access rights for directory only*/
  23173.     long filler6;
  23174.     long ioACOwnerID; /*owner ID*/
  23175.     long ioACGroupID; /*group ID*/
  23176.     long ioACAccess; /*access rights*/
  23177. };
  23178.  
  23179. typedef struct AccessParam AccessParam;
  23180. æC 
  23181.  
  23182. æKY ObjParam
  23183. æFc Files.h
  23184. æT struct
  23185. æD struct ObjParam {
  23186.     ParamBlockHeader 
  23187.     short filler7;
  23188.     short ioObjType; /*function code*/
  23189.     Ptr ioObjNamePtr; /*ptr to returned creator/group name*/
  23190.     long ioObjID; /*creator/group ID*/
  23191.     long ioReqCount; /*size of buffer area*/
  23192.     long ioActCount; /*length of vol parms data*/
  23193. };
  23194.  
  23195. typedef struct ObjParam ObjParam;
  23196. æC 
  23197.  
  23198. æKY CopyParam
  23199. æFc Files.h
  23200. æT struct
  23201. æD struct CopyParam {
  23202.     ParamBlockHeader 
  23203.     short ioDstVRefNum; /*destination vol identifier*/
  23204.     short filler8;
  23205.     Ptr ioNewName; /*ptr to destination pathname*/
  23206.     Ptr ioCopyName; /*ptr to optional name*/
  23207.     long ioNewDirID; /*destination directory ID*/
  23208.     long filler14;
  23209.     long filler15;
  23210.     long ioDirID; /*same as in FileParam*/
  23211. };
  23212.  
  23213. typedef struct CopyParam CopyParam;
  23214. æC 
  23215.  
  23216. æKY WDParam
  23217. æFc Files.h
  23218. æT struct
  23219. æD struct WDParam {
  23220.     ParamBlockHeader 
  23221.     short filler9;
  23222.     short ioWDIndex;
  23223.     long ioWDProcID;
  23224.     short ioWDVRefNum;
  23225.     short filler10;
  23226.     long filler11;
  23227.     long filler12;
  23228.     long filler13;
  23229.     long ioWDDirID;
  23230. };
  23231.  
  23232. typedef struct WDParam WDParam;
  23233. æC 
  23234.  
  23235. æKY FIDParam
  23236. æFc Files.h
  23237. æT struct
  23238. æD struct FIDParam {
  23239.     ParamBlockHeader 
  23240.     long filler1;
  23241.     Ptr ioDestNamePtr; /* dest file name */
  23242.     long filler2;
  23243.     long ioDestDirID; /* dest file's directory id */
  23244.     long filler3;
  23245.     long filler4;
  23246.     long ioSrcDirID; /* source file's directory id */
  23247.     short filler5;
  23248.     long ioFileID; /* file ID */
  23249. };
  23250.  
  23251. typedef struct FIDParam FIDParam;
  23252. /*  Catalog position record  */
  23253. æC 
  23254.  
  23255. æKY CatPositionRec
  23256. æFc Files.h
  23257. æT struct
  23258. æD struct CatPositionRec {
  23259.     long initialize;
  23260.     short priv[6];
  23261. };
  23262.  
  23263. typedef struct CatPositionRec CatPositionRec;
  23264. æC 
  23265.  
  23266. æKY FSSpec
  23267. FSSpecPtr
  23268. FSSpecHandle
  23269. æFc Files.h
  23270. æT struct
  23271. æD struct FSSpec {
  23272.     short vRefNum;
  23273.     long parID;
  23274.     Str63 name;
  23275. };
  23276.  
  23277. typedef struct FSSpec FSSpec;
  23278. typedef FSSpec *FSSpecPtr, **FSSpecHandle;
  23279.  
  23280. æC 
  23281.  
  23282. æKY CSParam
  23283. CSParamPtr
  23284. æFc Files.h
  23285. æT struct
  23286. æD struct CSParam {
  23287.     ParamBlockHeader 
  23288.     FSSpecPtr ioMatchPtr; /* match array */
  23289.     long ioReqMatchCount; /* maximum allowable matches */
  23290.     long ioActMatchCount; /* actual match count */
  23291.     long ioSpecBits; /* search criteria selector */
  23292.     CInfoPBPtr ioSpec1; /* search values and range lower bounds */
  23293.     CInfoPBPtr ioSpec2; /* search values and range upper bounds */
  23294.     long ioSearchTime; /* length of time to run search */
  23295.     CatPositionRec ioCatPosition; /* current position in the catalog */
  23296.     Ptr ioOptBuffer; /* optional performance enhancement buffer */
  23297.     long ioOptBufSize; /* size of buffer pointed to by ioOptBuffer */
  23298. };
  23299.  
  23300. typedef struct CSParam CSParam;
  23301. typedef CSParam *CSParamPtr;
  23302.  
  23303. æC 
  23304.  
  23305. æKY DTPBRec
  23306. DTPBPtr
  23307. æFc Files.h
  23308. æT struct
  23309. æD struct DTPBRec {
  23310.     ParamBlockHeader 
  23311.     short ioDTRefNum; /* desktop refnum */
  23312.     short ioIndex;
  23313.     long ioTagInfo;
  23314.     Ptr ioDTBuffer;
  23315.     long ioDTReqCount;
  23316.     long ioDTActCount;
  23317.     char ioFiller1;
  23318.     char ioIconType;
  23319.     short ioFiller2;
  23320.     long ioDirID;
  23321.     OSType ioFileCreator;
  23322.     OSType ioFileType;
  23323.     long ioFiller3;
  23324.     long ioDTLgLen;
  23325.     long ioDTPyLen;
  23326.     short ioFiller4[14];
  23327.     long ioAPPLParID;
  23328. };
  23329.  
  23330. typedef struct DTPBRec DTPBRec;
  23331. typedef DTPBRec *DTPBPtr;
  23332.  
  23333. æC 
  23334.  
  23335. æKY AltAccessParam
  23336. AltAccessParamPtr
  23337. æFc Files.h
  23338. æT struct
  23339. æD struct AltAccessParam {
  23340.     ParamBlockHeader 
  23341.     long ioFiller1;
  23342.     long ioFiller2;
  23343.     Ptr ioAltAccessBuffer;
  23344.     long ioAltReqCount;
  23345.     long ioAltActCount;
  23346.     long ioAltAccessInfo1;
  23347.     long ioAltAccessInfo2;
  23348.     long ioAltAccessInfo3;
  23349.     long ioAltAccessInfo4;
  23350. };
  23351.  
  23352. typedef struct AltAccessParam AltAccessParam;
  23353. typedef AltAccessParam *AltAccessParamPtr;
  23354.  
  23355. æC 
  23356.  
  23357. æKY HParamBlockRec
  23358. HParmBlkPtr
  23359. æFc Files.h
  23360. æT struct
  23361. æD union HParamBlockRec {
  23362.     HIOParam ioParam;
  23363.     HFileParam fileParam;
  23364.     HVolumeParam volumeParam;
  23365.     AccessParam accessParam;
  23366.     ObjParam objParam;
  23367.     CopyParam copyParam;
  23368.     WDParam wdParam;
  23369.     FIDParam fidParam;
  23370.     CSParam csParam;
  23371.     AltAccessParam altaccessParam;
  23372. };
  23373.  
  23374. typedef union HParamBlockRec HParamBlockRec;
  23375.  
  23376. typedef HParamBlockRec *HParmBlkPtr;
  23377.  
  23378. æC »FileParam Variant ( ParamBlockRec and HParamBlockRec)
  23379.  
  23380. The fileParam variants of ParamBlockRec and HParamBlockRec are identical, with one
  23381. exception:  The field ioDirID in HParamBlockRec is called ioFlNum in ParamBlockRec.
  23382. The fields of the fileParam variant of HParamBlockRec are as follows:  
  23383.  
  23384. •••Refer to Technical Note #204:•••
  23385.  
  23386.   fileParam:
  23387.    (ioFRefNum:     INTEGER;     {path reference number}
  23388.     ioFVersNum:    SignedByte;  {version number}
  23389.     filler1:       SignedByte;  {not used}
  23390.     ioFDirIndex:   INTEGER;     {index}
  23391.     ioFlAttrib:    SignedByte;  {file attributes}
  23392.     ioFlVersNum:   SignedByte;  {version number}
  23393.     ioFlFndrInfo:  FInfo;       {information used by the Finder}
  23394.     ioDirID:       LONGINT;     {directory ID or file number}
  23395.     ioFlStBlk:     INTEGER;     {first allocation block of data fork}
  23396.     ioFlLgLen:     LONGINT;     {logical end-of-file of data fork}
  23397.     ioFlPyLen:     LONGINT;     {physical end-of-file of data fork}
  23398.     ioFlRStBlk:    INTEGER;     {first allocation block of resource fork}
  23399.     ioFlRLgLen:    LONGINT;     {logical end-of-file of resource fork}
  23400.     ioFlRPyLen:    LONGINT;     {physical end-of-file of resource fork}
  23401.     ioFlCrDat:     LONGINT;     {date and time of creation}
  23402.     ioFlMdDat:     LONGINT);    {date and time of last modification}
  23403.  
  23404. IOFDirIndex can be used with the PBGetFInfo and PBHGetFInfo to index through the
  23405. files in a given directory.
  23406.  
  23407. Warning:  When used with GetFileInfo, ioFDirIndex will index only the files
  23408.           in a directory. To index both files and directories, you can use
  23409.           ioFDirIndex with PBGetCatInfo.
  23410.  
  23411. IOFlAttrib contains the following file attributes:
  23412.  
  23413.   Bit    Meaning
  23414.  
  23415.    0     Set if file is locked
  23416.    2     Set if resource fork is open
  23417.    3     Set if data fork is open
  23418.    4     Set if a directory
  23419.    7     Set if file (either fork) is open
  23420.  
  23421. When passed to a routine, ioDirID contains a directory ID; it can be used to refer to
  23422. a directory or, in conjuction with a partial pathname from that directory, to other
  23423. files and directories. If both a directory ID and a working directory reference
  23424. number are provided, the directory ID is used to identify the directory on the volume
  23425. indicated by the working directory reference number. In other words, a directory ID
  23426. specified by the caller will override the working directory referred to by the working
  23427. directory reference number. If you don’t want this to happen, you can set ioDirID to
  23428. 0. (If no directory is specified through a working directory reference number, the
  23429. root directory ID will be used.)
  23430.  
  23431. When returned from a routine, ioDirID contains the file number of a file; most programmers
  23432. needn’t be concerned with file numbers, but those interested can read the section
  23433. “Data Organization on Volumes”.
  23434.  
  23435. IOFlStBlk and ioFlRStBlk contain 0 if the file’s data or resource fork is empty,
  23436. respectively; they’re used only with flat volumes. The date and time in the ioFlCrDat
  23437. and ioFlMdDat fields are specified in seconds since midnight,
  23438. January 1, 1904.
  23439.  
  23440. »VolumeParam Variant (ParamBlockRec)
  23441.  
  23442. When you call GetVolInfo, you’ll use the volumeParam variant of ParamBlockRec:
  23443.  
  23444.   volumeParam:
  23445.    (filler2:      LONGINT;    {not used}
  23446.     ioVolIndex:   INTEGER;    {index}
  23447.     ioVCrDate:    LONGINT;    {date and time of initialization}
  23448.     ioVLsBkUp:    LONGINT;    {date and time of last modification}
  23449.     ioVAtrb:      INTEGER;    {volume attributes}
  23450.     ioVNmFls:     INTEGER;    {number of files in root directory}
  23451.     ioVDirSt:     INTEGER;    {first block of directory}
  23452.     ioVBlLn:      INTEGER;    {length of directory in blocks}
  23453.     ioVNmAlBlks:  INTEGER;    {number of allocation blocks}
  23454.     ioVAlBlkSiz:  LONGINT;    {size of allocation blocks}
  23455.     ioVClpSiz:    LONGINT;    {number of bytes to allocate}
  23456.     ioAlBlSt:     INTEGER;    {first block in volume block map}
  23457.     ioVNxtFNum:   LONGINT;    {next unused file number}
  23458.     ioVFrBlk:     INTEGER);   {number of unused allocation blocks}
  23459.  
  23460. IOVolIndex can be used to index through all the mounted volumes; using an index of 1
  23461. accesses the first volume mounted, and so on. (For more information on indexing, see
  23462. the section “Indexing” above.)
  23463.  
  23464. IOVLsBkUp contains the date and time the volume information was last modified
  23465. (this is not necessarily when it was flushed). (This field is not modified when
  23466. information is written to a file.)
  23467.  
  23468. Note:  The name ioVLsBkUp is actually a misnomer; this field has always
  23469.        contained the date and time of the last modification to the volume,
  23470.        not the last backup.
  23471.  
  23472. Most programmers needn’t be concerned with the remaining parameters, but interested
  23473. programmers can read the section “Data Organization on Volumes”.
  23474.  
  23475. »VolumeParam Variant (HParamBlockRec)
  23476.  
  23477. When you call HGetVInfo and SetVolInfo, you’ll use the volumeParam variant of HParamBlockRec.
  23478. This is a superset of the volumeParam variant of ParamBlockRec; the names and functions
  23479. of certain fields have been changed, and new fields have been added:
  23480.  
  23481.   volumeParam:
  23482.    (filler2:      LONGINT;    {not used}
  23483.     ioVolIndex:   INTEGER;    {index}
  23484.     ioVCrDate:    LONGINT;    {date and time of initialization}
  23485.     ioVLsMod:     LONGINT;    {date and time of last modification}
  23486.     ioVAtrb:      INTEGER;    {volume attributes}
  23487.     ioVNmFls:     INTEGER;    {number of files in root directory}
  23488.     ioVBitMap:    INTEGER;    {first block of volume bit map}
  23489.     ioAllocPtr:   INTEGER;    {block at which next new file starts}
  23490.     ioVNmAlBlks:  INTEGER;    {number of allocation blocks}
  23491.     ioVAlBlkSiz:  LONGINT;    {size of allocation blocks}
  23492.     ioVClpSiz:    LONGINT;    {number of bytes to allocate}
  23493.     ioAlBlSt:     INTEGER;    {first block in volume block map}
  23494.     ioVNxtCNID:   LONGINT;    {next unused file number}
  23495.     ioVFrBlk:     INTEGER;    {number of unused allocation blocks}
  23496.     ioVSigWord:   INTEGER;    {volume signature}
  23497.     ioVDrvInfo:   INTEGER;    {drive number}
  23498.     ioVDRefNum:   INTEGER;    {driver reference number}
  23499.     ioVFSID:      INTEGER;    {file system handling this volume}
  23500.     ioVBkUp:      LONGINT;    {date and time of last backup}
  23501.     ioVSeqNum:    INTEGER;    {used internally}
  23502.     ioVWrCnt      LONGINT;    {volume write count}
  23503.     ioVFilCnt:    LONGINT;    {number of files on volume}
  23504.     ioVDirCnt:    LONGINT;    {number of directories on volume}
  23505.     ioVFndrInfo:  ARRAY[1..8] OF LONGINT); {information used by the Finder}
  23506.  
  23507. IOVolIndex can be used to index through all the mounted volumes; using an index of 1
  23508. accesses the first volume mounted, and so on. (For more information on indexing, see
  23509. the section “Indexing” above.)
  23510.  
  23511. IOVLsMod contains the date and time the volume information was last modified
  23512. (this is not necessarily when it was flushed). (This field is not modified when
  23513. information is written to a file.)
  23514.  
  23515. Note:  IOVLsMod replaces the field ioVLsBkUp in ParamBlockRec. The name
  23516.        ioVLsBkUp was actually a misnomer; this field has always contained
  23517.        the date and time of the last modification, not the last backup.
  23518.        Another field, ioVBkUp, contains the date and time of the last backup.
  23519.  
  23520. IOVClpSiz can be used to set the volume clump size in bytes; it’s used for files that
  23521. don’t have a clump size defined as part of their file information in the catalog. To
  23522. promote file contiguity and avoid fragmentation, space is allocated to a file not in
  23523. allocation blocks but in clumps. A clump is a group of contiguous allocation blocks.
  23524. The clump size is always a multiple of the allocation block size; it’s the minimum
  23525. number of bytes to allocate each time the Allocate function is called or the end-of-file
  23526. is reached during the Write routine.
  23527.  
  23528. IOVSigWord contains a signature word identifying the type of volume; it’s $D2D7 for
  23529. flat directory volumes and $4244 for hierarchical directory volumes. The drive number
  23530. of the drive containing the volume is returned in ioDrvInfo. For on-line volumes,
  23531. ioVDRefNum returns the reference number of the I/O driver for the drive identified by
  23532. ioDrvInfo.
  23533.  
  23534. IOVFSID is the file-system identifier. It indicates which file system is servicing
  23535. the volume; it’s 0 for File Manager volumes and nonzero for volumes handled by an
  23536. external file system.
  23537.  
  23538. IOVBkUp specifies the date and time the volume was last backed up (it’s 0 if never
  23539. backed up).
  23540.  
  23541. IOVNmFls contains the number of files in the root directory. IOVFilCnt contains the
  23542. total number of files on the volume, while ioVDirCnt contains the total number of
  23543. directories (not including the root directory).
  23544.  
  23545. Most programmers needn’t be concerned with the other parameters, but interested
  23546. programmers can read the section “Data Organization on Volumes”.
  23547.  
  23548. HParamBlockRec, described above, has been extended to support a shared environment
  23549. with the addition of AccessParam, ObjParam, CopyParam, and
  23550. WDParam, as shown below.  (The complete HParamBlockRec data type is shown in the
  23551. summary.)
  23552.  
  23553.   AccessParam:
  23554.    (filler3:       INTEGER;
  23555.     ioDenyModes:   INTEGER;      {access rights data}
  23556.     filler4:       INTEGER;
  23557.     filler5:       Signed Byte;
  23558.     ioACUser:      Signed Byte;  {access rights for directory only}
  23559.     filler6:       LONGINT;
  23560.     ioACOwnerID:   LONGINT;      {owner ID}
  23561.     ioACGroupID:   LONGINT;      {group ID}
  23562.     ioACAccess:    LONGINT);     {access rights}
  23563.  
  23564.   ObjParam:
  23565.    (filler7:       INTEGER;
  23566.     ioObjType:     INTEGER;   {function code}
  23567.     ioObjNamePtr:  Ptr;       {ptr to returned creator/group name}
  23568.     ioObjID:       LONGINT;   {creator/group ID}
  23569.     ioReqCount:    LONGINT;   {size of buffer area}
  23570.     ioActCount:    LONGINT);  {length of vol parms data}
  23571.  
  23572.   CopyParam:
  23573.    (ioDstVRefNum:  INTEGER;   {destination vol identifier}
  23574.     filler8:       INTEGER;
  23575.     ioNewName:     Ptr;       {ptr to destination pathname}
  23576.     ioCopyName:    Ptr;       {ptr to optional name}
  23577.     ioNewDirID:    LONGINT);  {destination directory ID}
  23578.  
  23579.   WDParam:
  23580.    (filler9:       INTEGER;
  23581.     ioWDIndex:     INTEGER;
  23582.     ioWDProcID:    LONGINT;
  23583.     ioWDVRefNum:   INTEGER;
  23584.     filler10:      INTEGER;
  23585.     filler11:      LONGINT;
  23586.     filler12:      LONGINT;
  23587.     filler13:      LONGINT;
  23588.     ioWDDirID:     LONGINT);
  23589.  
  23590. æKY CMovePBRec
  23591. CMovePBPtr
  23592. æFc Files.h
  23593. æT struct
  23594. æD struct CMovePBRec {
  23595.     QElemPtr qLink;
  23596.     short qType;
  23597.     short ioTrap;
  23598.     Ptr ioCmdAddr;
  23599.     ProcPtr ioCompletion;
  23600.     OSErr ioResult;
  23601.     StringPtr ioNamePtr;
  23602.     short ioVRefNum;
  23603.     long filler1;
  23604.     StringPtr ioNewName;
  23605.     long filler2;
  23606.     long ioNewDirID;
  23607.     long filler3[2];
  23608.     long ioDirID;
  23609. };
  23610.  
  23611. typedef struct CMovePBRec CMovePBRec;
  23612. typedef CMovePBRec *CMovePBPtr;
  23613.  
  23614. æC 
  23615.  
  23616. »CMovePBRec
  23617.  
  23618. When you call CatMove to move files or directories into a different directory, you’ll
  23619. use the following six additional fields after the standard eight fields in the parameter
  23620. block record CMovePBRec:
  23621.  
  23622.   filler1:     LONGINT;    {not used}
  23623.   ioNewName:   StringPtr;  {name of new directory}
  23624.   filler2:     LONGINT;    {not used}
  23625.   ioNewDirID:  LONGINT;    {directory ID of new directory}
  23626.   filler3:     ARRAY[1..2] OF LONGINT; {not used}
  23627.   ioDirID:     LONGINT);   {directory ID of current directory}
  23628.  
  23629. IONewName and ioNewDirID specify the name and directory ID of the directory to which
  23630. the file or directory is to be moved. IODirID (used in conjuntion with the ioVRefNum
  23631. and ioNamePtr) specifies the current directory ID of the file or directory to be
  23632. moved.
  23633.  
  23634. æKY WDPBRec
  23635. WDPBPtr
  23636. æFc Files.h
  23637. æT struct
  23638. æD struct WDPBRec {
  23639.     QElemPtr qLink;
  23640.     short qType;
  23641.     short ioTrap;
  23642.     Ptr ioCmdAddr;
  23643.     ProcPtr ioCompletion;
  23644.     OSErr ioResult;
  23645.     StringPtr ioNamePtr;
  23646.     short ioVRefNum;
  23647.     short filler1;
  23648.     short ioWDIndex;
  23649.     long ioWDProcID;
  23650.     short ioWDVRefNum;
  23651.     short filler2[7];
  23652.     long ioWDDirID;
  23653. };
  23654.  
  23655. typedef struct WDPBRec WDPBRec;
  23656. typedef WDPBRec *WDPBPtr;
  23657.  
  23658. æC 
  23659.  
  23660. »WDPBRec
  23661.  
  23662. When you call the routines that open, close, and get information about working directories,
  23663. you’ll use the following six additional fields after the standard eight fields in the
  23664. parameter block record WDPBRec:
  23665.  
  23666.   filler1:      INTEGER;    {not used}
  23667.   ioWDIndex:    INTEGER;    {index}
  23668.   ioWDProcID:   LONGINT;    {working directory user identifier}
  23669.   ioWDVRefNum:  INTEGER;    {working directory's volume reference number}
  23670.   filler2:      ARRAY[1..7] OF INTEGER;  {not used}
  23671.   ioWDDirID:    LONGINT);   {working directory's directory ID}
  23672.  
  23673. IOWDIndex can be used with the function PBGetWDInfo to index through the current
  23674. working directories.
  23675.  
  23676. IOWDProcID is an identifier that’s used to distinguish between working directories
  23677. set up by different users; you should use the application’s signature (discussed in
  23678. the Finder Interface chapter) as the ioWDProcID.
  23679.  
  23680. æKY FCBPBRec
  23681. FCBPBPtr
  23682. æFc Files.h
  23683. æT struct
  23684. æD struct FCBPBRec {
  23685.     QElemPtr qLink;
  23686.     short qType;
  23687.     short ioTrap;
  23688.     Ptr ioCmdAddr;
  23689.     ProcPtr ioCompletion;
  23690.     OSErr ioResult;
  23691.     StringPtr ioNamePtr;
  23692.     short ioVRefNum;
  23693.     short ioRefNum;
  23694.     short filler;
  23695.     short ioFCBIndx;
  23696.     short filler1;
  23697.     long ioFCBFlNm;
  23698.     short ioFCBFlags;
  23699.     unsigned short ioFCBStBlk;
  23700.     long ioFCBEOF;
  23701.     long ioFCBPLen;
  23702.     long ioFCBCrPs;
  23703.     short ioFCBVRefNum;
  23704.     long ioFCBClpSiz;
  23705.     long ioFCBParID;
  23706. };
  23707.  
  23708. typedef struct FCBPBRec FCBPBRec;
  23709. typedef FCBPBRec *FCBPBPtr;
  23710.  
  23711. æC 
  23712.  
  23713. æKY VCB
  23714. æFc Files.h
  23715. æT struct
  23716. æD struct VCB {
  23717.     QElemPtr qLink;
  23718.     short qType;
  23719.     short vcbFlags;
  23720.     unsigned short vcbSigWord;
  23721.     unsigned long vcbCrDate;
  23722.     unsigned long vcbLsMod;
  23723.     short vcbAtrb;
  23724.     unsigned short vcbNmFls;
  23725.     short vcbVBMSt;
  23726.     short vcbAllocPtr;
  23727.     unsigned short vcbNmAlBlks;
  23728.     long vcbAlBlkSiz;
  23729.     long vcbClpSiz;
  23730.     short vcbAlBlSt;
  23731.     long vcbNxtCNID;
  23732.     unsigned short vcbFreeBks;
  23733.     Str27 vcbVN;
  23734.     short vcbDrvNum;
  23735.     short vcbDRefNum;
  23736.     short vcbFSID;
  23737.     short vcbVRefNum;
  23738.     Ptr vcbMAdr;
  23739.     Ptr vcbBufAdr;
  23740.     short vcbMLen;
  23741.     short vcbDirIndex;
  23742.     short vcbDirBlk;
  23743.     unsigned long vcbVolBkUp;
  23744.     unsigned short vcbVSeqNum;
  23745.     long vcbWrCnt;
  23746.     long vcbXTClpSiz;
  23747.     long vcbCTClpSiz;
  23748.     unsigned short vcbNmRtDirs;
  23749.     long vcbFilCnt;
  23750.     long vcbDirCnt;
  23751.     long vcbFndrInfo[8];
  23752.     unsigned short vcbVCSize;
  23753.     unsigned short vcbVBMCSiz;
  23754.     unsigned short vcbCtlCSiz;
  23755.     unsigned short vcbXTAlBlks;
  23756.     unsigned short vcbCTAlBlks;
  23757.     short vcbXTRef;
  23758.     short vcbCTRef;
  23759.     Ptr vcbCtlBuf;
  23760.     long vcbDirIDM;
  23761.     short vcbOffsM;
  23762. };
  23763.  
  23764. typedef struct VCB VCB;
  23765. æC 
  23766. »Volume Control Blocks
  23767.  
  23768. •••Refer to Technical Note #106:•••
  23769.  
  23770. Each time a volume is mounted, its volume information is read from it and is used to
  23771. build a new volume control block in the volume-control-block queue
  23772. (unless an ejected or off-line volume is being remounted). A copy of the volume block
  23773. map is also read from the volume and placed in the system heap, and a volume buffer
  23774. is created in the system heap.
  23775.  
  23776. The volume-control-block queue is a standard Operating System queue that’s maintained
  23777. in the system heap. It contains a volume control block for each mounted volume. A
  23778. volume control block is a 178-byte nonrelocatable block that contains volume-specific
  23779. information. It has the following structure:
  23780.  
  23781. TYPE VCB = RECORD
  23782.              qLink:        QElemPtr;   {next queue entry}
  23783.              qType:        INTEGER;    {queue type}
  23784.              vcbFlags:     INTEGER;    {bit 15=1 if dirty}
  23785.              vcbSigWord:   INTEGER;    {$4244 for hierarchical, $D2D7 for flat}
  23786.              vcbCrDate:    LONGINT;    {date and time of initialization}
  23787.              vcbLsMod:     LONGINT;    {date and time of last modification}
  23788.              vcbAtrb:      INTEGER;    {volume attributes}
  23789.              vcbNmFls:     INTEGER;    {number of files in directory}
  23790.              vcbVBMSt:     INTEGER;    {first block of volume bit map}
  23791.              vcbAllocPtr:  INTEGER;    {used internally}
  23792.              vcbNmAlBlks:  INTEGER;    {number of allocation blocks}
  23793.              vcbAlBlkSiz:  LONGINT;    {allocation block size}
  23794.              vcbClpSiz:    LONGINT;    {default clump size}
  23795.              vcbAlBlSt:    INTEGER;    {first block in block map}
  23796.              vcbNxtCNID:   LONGINT;    {next unused directory ID or file number}
  23797.              vcbFreeBks:   INTEGER;    {number of unused allocation blocks}
  23798.              vcbVN:        STRING[27]; {volume name}
  23799.              vcbDrvNum:    INTEGER;    {drive number}
  23800.              vcbDRefNum:   INTEGER;    {driver reference number}
  23801.              vcbFSID:      INTEGER;    {file-system identifier}
  23802.              vcbVRefNum:   INTEGER;    {volume reference number}
  23803.              vcbMAdr:      Ptr;        {pointer to block map}
  23804.              vcbBufAdr:    Ptr;        {pointer to volume buffer}
  23805.              vcbMLen:      INTEGER;    {number of bytes in block map}
  23806.              vcbDirIndex:  INTEGER;    {used internally}
  23807.              vcbDirBlk:    INTEGER;    {used internally}
  23808.              vcbVolBkUp:   LONGINT;    {date and time of last backup}
  23809.              vcbVSeqNum:   INTEGER;    {used internally}
  23810.              vcbWrCnt:     LONGINT;    {volume write count}
  23811.              vcbXTClpSiz:  LONGINT;    {clump size of extents tree file}
  23812.              vcbCTClpSiz:  LONGINT;    {clump size of catalog tree file}
  23813.              vcbNmRtDirs:  INTEGER;    {number of directories in root}
  23814.              vcbFilCnt:    LONGINT;    {number of files on volume}
  23815.              vcbDirCnt:    LONGINT;    {number of directories on volume}
  23816.              vcbFndrInfo:  ARRAY[1..8] OF LONGINT;  {information used by }
  23817.                                                     { the Finder}
  23818.              vcbVCSize:    INTEGER;    {used internally}
  23819.              vcbVBMCSiz:   INTEGER;    {used internally}
  23820.              vcbCtlCSiz:   INTEGER;    {used internally}
  23821.              vcbXTAlBks:   INTEGER;    {size in blocks of extents tree file}
  23822.              vcbCTAlBks:   INTEGER;    {size in blocks of catalog tree file}
  23823.              vcbXTRef:     INTEGER;    {path reference number for extents }
  23824.                                        { tree file}
  23825.              vcbCTRef:     INTEGER;    {path reference number for catalog }
  23826.                                        { tree file}
  23827.              vcbCtlBuf:    Ptr;        {pointer to extents and catalog }
  23828.                                        { tree caches}
  23829.              vcbDirIDM:    LONGINT;    {directory last searched}
  23830.              vcbOffsM:     INTEGER     {offspring index at last search}
  23831.            END;
  23832.  
  23833. 64K ROM note:  A volume control block created for a flat volume is a subset
  23834.                of the above structure. It’s actually smaller and contains
  23835.                only the fields up to and including vcbDirBlk. In addition,
  23836.                the names of several fields have been changed to reflect the
  23837.                fact that they contain different information on hierarchical
  23838.                volumes:  vcbLsBkUp, vcbDirSt, vcbBlLn, vcbNmBlks, and
  23839.                vcbNxtFNum have been changed to vcbLsMod, vcbVBMSt,
  23840.                vcbAllocPtr, vcbNmAlBlks, and vcbNxtCNID respectively.
  23841.  
  23842. QLink points to the next entry in the queue, and qType indicates the queue type,
  23843. which must always be ORD(fsQType). Bit 15 of vcbFlags is set if the volume information
  23844. has been changed by a routine call since the volume was last affected by a FlushVol
  23845. call.
  23846.  
  23847. VCBLsMod contains the date and time that the volume was last modified (this is not
  23848. necessarily when it was flushed).
  23849.  
  23850. 64K ROM note:  VCBLsMod replaces the field vcbLsBkUp from flat directory
  23851.                volumes. The name vcbLsBkUp was actually a misnomer; this
  23852.                field has always contained the date and time of the last
  23853.                modification, not the last backup. Another field, vcbVolBkUp,
  23854.                contains the date and time of the last backup.
  23855.  
  23856. VCBAtrb contains the volume attributes, as follows:
  23857.  
  23858.   Bit    Meaning
  23859.   0–4    Set if inconsistencies were found between the volume
  23860.          information and the file directory when the volume was mounted
  23861.   6      Set if volume is busy (one or more files are open)
  23862.   7      Set if volume is locked by hardware
  23863.   15     Set if volume is locked by software
  23864.  
  23865. VCBVBMSt contains the number of the first block in the volume bit map; on flat volumes,
  23866. it contains the first block of the file directory. VCBNmAlBlks contains the number of
  23867. allocation blocks on the volume, and vcbFreeBks specifies how many of those blocks
  23868. are unused. VCBAlBlSt is used only with flat volumes; it contains the number of the
  23869. first block in the block map.
  23870.  
  23871. VCBDrvNum contains the drive number of the drive on which the volume is mounted;
  23872. vcbDRefNum contains the driver reference number of the driver used to access the
  23873. volume. When a mounted volume is placed off-line, vcbDrvNum is cleared. When a volume
  23874. is ejected, vcbDrvNum is cleared and vcbDRefNum is set to the negative of vcbDrvNum
  23875. (becoming a positive number). VCBFSID identifies the file system handling the volume;
  23876. it’s 0 for volumes handled by the File Manager, and nonzero for volumes handled by
  23877. other file systems.
  23878.  
  23879. When a volume is placed off-line, its buffer and bit map (or block map, in the case
  23880. of flat directory volumes) are released. When a volume is unmounted, its volume
  23881. control block is removed from the volume-control-block queue.
  23882.  
  23883. You can get a pointer to the header of the volume-control-block queue by calling the
  23884. File Manager function GetVCBQHdr.
  23885.  
  23886. æKY DrvQEl
  23887. DrvQElPtr
  23888. æFc Files.h
  23889. æT struct
  23890. æD struct DrvQEl {
  23891.     QElemPtr qLink;
  23892.     short qType;
  23893.     short dQDrive;
  23894.     short dQRefNum;
  23895.     short dQFSID;
  23896.     unsigned short dQDrvSz;
  23897.     unsigned short dQDrvSz2;
  23898. };
  23899.  
  23900. typedef struct DrvQEl DrvQEl;
  23901. typedef DrvQEl *DrvQElPtr;
  23902.  
  23903. æC 
  23904. »The Drive Queue
  23905.  
  23906. •••Refer to Technical Note #36:•••
  23907.  
  23908. Disk drives connected to the Macintosh are opened when the system starts up, and
  23909. information describing each is placed in the drive queue. This is a standard Operating
  23910. System queue, and each entry in it has the following structure:
  23911.  
  23912. TYPE DrvQEl =  RECORD
  23913.                  qLink:     QElemPtr;   {next queue entry}
  23914.                  qType:     INTEGER;    {queue type}
  23915.                  dQDrive:   INTEGER;    {drive number}
  23916.                  dQRefNum:  INTEGER;    {driver reference number}
  23917.                  dQFSID:    INTEGER;    {file-system identifier}
  23918.                  dQDrvSz:   INTEGER;    {number of logical blocks on drive}
  23919.                  dQDrvSz2:  INTEGER;    {additional field to handle large }
  23920.                                         { drive size}
  23921.                END;
  23922.  
  23923. QLink points to the next entry in the queue. If qType is 0, this means the number of
  23924. logical blocks on the drive is contained in the dQDrvSz field alone. If qType is 1,
  23925. both dQDrvSz and dQDrvSz2 are used to store the number of blocks; dqDrvSz2 contains
  23926. the high-order word of this number and dQDrvSz contains the low-order word.
  23927.  
  23928. DQDrive contains the drive number of the drive on which the volume is mounted; dQRefNum
  23929. contains the driver reference number of the driver controlling the device on which
  23930. the volume is mounted. DQFSID identifies the file system handling the volume in the
  23931. drive; it’s 0 for volumes handled by the File Manager, and nonzero for volumes handled
  23932. by other file systems.
  23933.  
  23934. Four bytes of flags precede each drive queue entry; they’re accessible only from
  23935. assembly language.
  23936.  
  23937. Assembly-language note:  These bytes contain the following:
  23938.  
  23939.                            Byte    Contents
  23940.                            0       Bit 7=1 if volume is locked
  23941.                            1       0 if no disk in drive; 1 or 2 if disk
  23942.                                    in drive; 8 if nonejectable disk in drive;
  23943.                                    $FC-$FF if disk was ejected within last 1.5
  23944.                                    seconds; $48 if disk in drive is
  23945.                                    nonejectable but driver wants a call
  23946.                            2       Used internally during system startup
  23947.                            3       Bit 7=0 if disk is single-sided
  23948.  
  23949. You can get a pointer to the header of the drive queue by calling the File Manager
  23950. function GetDrvQHdr.
  23951.  
  23952. æKY NumVersion
  23953. æFc Files.h
  23954. æT struct
  23955. æD struct NumVersion {
  23956.     unsigned char majorRev; /*1st part of version number in BCD*/
  23957.     unsigned int minorRev : 4; /*2nd part is 1 nibble in BCD*/
  23958.     unsigned int bugFixRev : 4; /*3rd part is 1 nibble in BCD*/
  23959.     unsigned char stage; /*stage code: dev, alpha, beta, final*/
  23960.     unsigned char nonRelRev; /*revision level of non-released version*/
  23961. };
  23962.  
  23963. typedef struct NumVersion NumVersion;
  23964. /* Numeric version part of 'vers' resource */
  23965. æC 
  23966.  
  23967. æKY VersRec
  23968. VersRecPtr
  23969. VersRecHndl
  23970. æFc Files.h
  23971. æT struct
  23972. æD struct VersRec {
  23973.     NumVersion numericVersion; /*encoded version number*/
  23974.     short countryCode; /*country code from intl utilities*/
  23975.     Str255 shortVersion; /*version number string - worst case*/
  23976.     Str255 reserved; /*longMessage string packed after shortVersion*/
  23977. };
  23978.  
  23979. typedef struct VersRec VersRec;
  23980. typedef VersRec *VersRecPtr, **VersRecHndl;
  23981.  
  23982. /* 'vers' resource format */
  23983. æC 
  23984.  
  23985. æKY PBHGetVolParms
  23986. æFc Files.h
  23987. æT Function
  23988. æD pascal OSErr PBHGetVolParms(HParmBlkPtr paramBlock,Boolean async); 
  23989. æDT OSErr myVariable = PBHGetVolParms((HParmBlkPtr) paramBlock,(Boolean) async);
  23990. æRI V-392, VI
  23991. æC 
  23992. Trap macro    _GetVolParms
  23993.  
  23994. Parameter block
  23995.   Æ   12  ioCompletion  long  pointer to completion routine
  23996.   ¨   16  ioResult      word  error result code
  23997.   Æ   18  ioFileName    long  volume name specifier
  23998.   Æ   22  ioVRefNum     word  volume refNum
  23999.   ¨   32  ioBuffer      long  pointer to attributes buffer
  24000.   Æ   36  ioReqCount    long  size of buffer area
  24001.   ¨   40  ioActCount    long  length of volume parms data
  24002.  
  24003. <See the description in Volume V. We have a new version of the attributes buffer
  24004. and new values for vMAttrib:>
  24005.  
  24006. Attributes buffer
  24007.   0  vMVersion        word    version number (02 for this version)
  24008.   2  vMAttrib         long    attributes (detailed below)
  24009.   6  vMLocalHand      long    handle to private data for shared volumes
  24010.   10  vMServerAdr     long    AppleTalk server address (0 if not supported)
  24011.   14  vMVolumeGrade   long    Approximate speed rating of volume
  24012.   18  vMAltPrivModel  word    Alternative privilege model supported
  24013.                               (two values currently defined:
  24014.                                0 for an HFS volume;
  24015.                                1 for an A/UX volume)
  24016.  
  24017. Bit positions in vMAttrib
  24018.   31  bLimitFCBs   Limit the number of FCBs used during copying
  24019.                    to 8 instead of 16.
  24020.  
  24021.   30  bLocalWList  Use the returned shared volume handle for the
  24022.                    Finder’s local window list.
  24023.  
  24024.   29  bNoMiniFndr  Disable Mini Finder menu item.
  24025.  
  24026.   28  bNoVNEdit  Lock volume name against editing.
  24027.  
  24028.   27  bNoLclSync  Do not let Finder change the modification date.
  24029.  
  24030.   26  bTrshOffLine  Zoom volume when it goes off line 
  24031.                     to the Trash and when it’s unmounted.
  24032.  
  24033.   25  bNoSwitchTo  Do not switch-launch to any application on the
  24034.                    volume.
  24035.  
  24036.   24-21  Reserved. Server volumes return these bits set.
  24037.                    All other volumes return these bits cleared.
  24038.  
  24039.   20  bNoDeskItems  Do not place objects on the Finder desktop.
  24040.  
  24041.   19  bNoBootBlks  Not a startup volume.
  24042.                    Startup menu item disabled.
  24043.                    Bootblocks not copied.
  24044.  
  24045.   18  bAccessCntl  Volume supports AppleTalk AFP access 
  24046.                    control interfaces. The functions GetLoginInfo, 
  24047.                    GetDirAccess, SetDirAccess, MapID, and 
  24048.                    MapName are supported. Special folder icons are 
  24049.                    used. Access Privileges menu item is enabled
  24050.                    for disk and folder items. The privileges field of 
  24051.                    GetCatInfo calls are assumed to be valid.
  24052.  
  24053.   17  bNoSysDir  Volume doesn’t support a system directory.
  24054.  
  24055.       Do not switch launch to this volume.
  24056.  
  24057.   16  bExtFSVol  Volume is an external file system volume. 
  24058.       Disk initialization package is not called. Erase 
  24059.       Disk menu item is disabled.
  24060.  
  24061.   15  bHasOpenDeny  Volume supports _OpenDeny and 
  24062.                     _OpenRFDeny. For copy operations, source files
  24063.                     are opened with enable read/deny write and 
  24064.                     destination files are opened enable write/deny 
  24065.                     read and write.
  24066.  
  24067.   14  bHasCopyFile  Volume supports _CopyFile. _CopyFile is 
  24068.                     used in copy and duplicate operations if both 
  24069.                     source and destination volumes have same server
  24070.                     address.
  24071.  
  24072.   13  bHasMoveRename  Volume supports _MoveRename.
  24073.  
  24074.   12  bHasNewDesk  Volume supports all of the new desktop 
  24075.                    functions (described in Volume V).
  24076.  
  24077.   11  bHasShortName  Volume supports a name that fits the requirements
  24078.                      of another file system.
  24079.  
  24080.   10  bHasFolderLock  Folder is locked.
  24081.  
  24082.    9  bHasPersonalAccessPrivileges  Macintosh File Share is running.
  24083.  
  24084.    8  bHasUserGroupList  Volume supports the Users and Groups file and
  24085.                          thus the AFP privilege functions.
  24086.  
  24087.    7  bHasCatSearch  Volume supports PBCatSearch.
  24088.  
  24089.    6  bHasFileIDs  Volume supports fileID functions
  24090.  
  24091.    5  For internal use only
  24092.  
  24093.   4-0 Reserved. All volumes return these bits clear.
  24094.  
  24095. æKY PBHGetLogInInfo
  24096. æFc Files.h
  24097. æT Function
  24098. æD pascal OSErr PBHGetLogInInfo(HParmBlkPtr paramBlock,Boolean async); 
  24099. æDT OSErr myVariable = PBHGetLogInInfo((HParmBlkPtr) paramBlock,(Boolean) async);
  24100. æRI V-393
  24101. æC 
  24102. Trap macro    _GetLogInInfo
  24103.  
  24104. Parameter block
  24105.   -->    12    ioCompletion  long    optional completion routine ptr
  24106.   <--    16    ioResult      word    error result code
  24107.   -->    22    ioVRefNum     word    volume refNum
  24108.   <--    26    ioObjType     word    log in method
  24109.   <--    28    ioObjNamePtr  long    ptr to log in name buffer
  24110.  
  24111. PBHGetLogInInfo returns the method used for log-in and the user name specified at
  24112. log-in time for the volume.  The log-in user name is returned as a Pascal string in
  24113. ioObjNamePtr.  The maximum size of the user name is 31 characters.  The log-in method
  24114. type is returned in ioObjType.
  24115.  
  24116. æKY PBHGetDirAccess
  24117. æFc Files.h
  24118. æT Function
  24119. æD pascal OSErr PBHGetDirAccess(HParmBlkPtr paramBlock,Boolean async); 
  24120. æDT OSErr myVariable = PBHGetDirAccess((HParmBlkPtr) paramBlock,(Boolean) async);
  24121. æRI V-394
  24122. æC 
  24123. Trap macro    _GetDirAccess
  24124.  
  24125. Parameter block
  24126.   -->    12    ioCompletion  long    optional completion routine ptr
  24127.   <--    16    ioResult      word    error result code
  24128.   -->    18    ioFileName    long    directory name
  24129.   -->    22    ioVRefNum     word    volume refNum
  24130.   <--    36    ioACOwnerID   long    owner ID
  24131.   <--    40    ioACGroupID   long    group ID
  24132.   <--    44    ioACAccess    long    access rights
  24133.   -->    48    ioDirID       long    directory ID
  24134.  
  24135. PBHGetDirAccess returns access control information for the folder pointed to by the
  24136. ioDirID/ioFIleName pair.  ioACOwnerID will return the ID for the folder’s owner. 
  24137. ioACGroupID will return the ID for the folder’s primary group.  The access rights are
  24138. returned in ioACAccess.
  24139.  
  24140. A fnfErr is returned if the pathname does not point to a valid directory.  An AccessDenied
  24141. error is returned if the user does not have the correct access rights to examine this
  24142. directory.
  24143.  
  24144. æKY PBHSetDirAccess
  24145. æFc Files.h
  24146. æT Function
  24147. æD pascal OSErr PBHSetDirAccess(HParmBlkPtr paramBlock,Boolean async); 
  24148. æDT OSErr myVariable = PBHSetDirAccess((HParmBlkPtr) paramBlock,(Boolean) async);
  24149. æRI V-394
  24150. æC 
  24151. Trap macro    _SetDirAccess
  24152.  
  24153. Parameter block
  24154.   -->    12    ioCompletion  long    optional completion routine ptr
  24155.   <--    16    ioResult      word    error result code
  24156.   -->    18    ioFileName    long    pathname identifier
  24157.   -->    22    ioVRefNum     word    volume refNum
  24158.   -->    36    ioACOwnerID   long    owner ID
  24159.   -->    40    ioACGroupID   long    group ID
  24160.   -->    44    ioACAccess    long    access rights
  24161.   -->    48    ioDirID       long    directory ID
  24162.  
  24163. PBHSetDirAccess allows you to change the access rights to a folder pointed to by the
  24164. ioFileName/ioDirID pair.  IOACOwnerID contains the new owner ID.  IOACGroupID contains
  24165. the group ID.  IOACAccess contains the folder’s access rights.  You cannot set the
  24166. owner bit or the user’s rights of the directory.  To change the owner or group, you
  24167. should set the ioACOwnerID or ioACGroupID field with the appropriate ID of the new
  24168. owner/group.  You must be the owner of the directory to change the owner or group
  24169. ID.
  24170.  
  24171. A fnfErr is returned if the pathname does not point to a valid directory.  An AccessDenied
  24172. error is returned if you do not have the correct access rights to modify the parameters
  24173. for this directory.  A paramErr is returned if you try to set the owner bit or user’s
  24174. rights bits.
  24175.  
  24176. æKY PBHMapID
  24177. æFc Files.h
  24178. æT Function
  24179. æD pascal OSErr PBHMapID(HParmBlkPtr paramBlock,Boolean async); 
  24180. æDT OSErr myVariable = PBHMapID((HParmBlkPtr) paramBlock,(Boolean) async);
  24181. æRI V-395
  24182. æC 
  24183. Trap macro    _MapID
  24184.  
  24185. Parameter block
  24186.   -->    12    ioCompletion  long    optional completion routine ptr
  24187.   <--    16    ioResult      word    error result code
  24188.   -->    18    ioFileName    long    pathname identifier
  24189.   -->    22    ioVRefNum     word    volume refNum
  24190.   -->    26    ioObjType     word    function code
  24191.   <--    28    ioObjNamePtr  long    ptr to retrnd creator/group name
  24192.   -->    32    ioObjID       long    creator/group ID
  24193.  
  24194. PBHMapID returns the name of a user or group given its unique ID.  IOObjID contains
  24195. the ID to be mapped.  The value zero for ioObjID is special cased and will always
  24196. return a NIL name.  AppleShare uses this to signify <Any User>.  IOObjType is the
  24197. mapping function code; it’s 1 if you’re mapping an owner ID to owner name or 2 if
  24198. you’re mapping a group ID to a group name.  The name is returned as a Pascal string
  24199. in ioObjNamePtr.  The maximum size of the name is 31 characters.
  24200.  
  24201. A fnfErr is returned if an unrecognizable owner or group ID is passed.
  24202.  
  24203. æKY PBHMapName
  24204. æFc Files.h
  24205. æT Function
  24206. æD pascal OSErr PBHMapName(HParmBlkPtr paramBlock,Boolean async); 
  24207. æDT OSErr myVariable = PBHMapName((HParmBlkPtr) paramBlock,(Boolean) async);
  24208. æRI V-395
  24209. æC 
  24210. Trap macro    _MapName
  24211.  
  24212. Parameter block
  24213.   -->    12    ioCompletion  long    optional completion routine ptr
  24214.   <--    16    ioResult      word    error result code
  24215.   -->    18    ioFileName    long    volume identifier (may be NIL)
  24216.   -->    22    ioVRefNum     word    volume refNum
  24217.   -->    28    ioObjNamePtr  long    owner or group name
  24218.   -->    26    ioObjType     word    function code
  24219.   <--    32    ioObjID       long    creator/group ID
  24220.  
  24221. PBHMapName returns the unique user ID or group ID given its name.  The name is passed
  24222. as a string in ioObjNamePtr.  If a NIL name is passed, the ID returned will always be
  24223. zero.  The maximum size of the name is 31 characters.  IOObjType is the mapping
  24224. function code; it’s 3 if you’re mapping an owner name to owner ID or 4 if you’re
  24225. mapping a group name to a group ID.  IOObjID will contain the mapped ID.
  24226.  
  24227. A fnfErr is returned if an unrecognizable owner or group name is passed.
  24228.  
  24229. æKY PBHCopyFile
  24230. æFc Files.h
  24231. æT Function
  24232. æD pascal OSErr PBHCopyFile(HParmBlkPtr paramBlock,Boolean async); 
  24233. æDT OSErr myVariable = PBHCopyFile((HParmBlkPtr) paramBlock,(Boolean) async);
  24234. æRI V-396
  24235. æC 
  24236. Trap macro    _CopyFile
  24237.  
  24238. Parameter block
  24239.   -->    12    ioCompletion  long    optional completion routine ptr
  24240.   <--    16    ioResult      word    error result code
  24241.   -->    18    ioFileName    long    ptr to source pathname
  24242.   -->    22    ioVRefNum     word    source vol identifier
  24243.   -->    24    ioDstVRefNum  word    destination vol identifier
  24244.   -->    28    ioNewName     long    ptr to destination pathname
  24245.   -->    32    ioCopyName    long    ptr to optional name (may be NIL)
  24246.   -->    36    ioNewDirID    long    destination directory ID
  24247.   -->    48    ioDirID       long    source directory ID
  24248.  
  24249. PBHCopyFile duplicates a file on the volume and optionally renames it.  It is an
  24250. optional call for AppleShare file servers.  You should examine the returned flag
  24251. information in the PBHGetVolParms call to see if this volume supports CopyFile.
  24252.  
  24253. For AppleShare file servers, the source and destination pathnames must indicate the
  24254. same file server; however, it may point to a different volume for that file server. 
  24255. A useful way to tell if two file server volumes are on the same file server is to
  24256. make the GetVolParms call and compare the server addresses returned.  The server will
  24257. open source files with read/deny write enabled and destination files with write/deny
  24258. read and write enabled.
  24259.  
  24260. IOVRefNum contains a source volume identifier.  The source pathname is determined by
  24261. the ioFileName/ioDirID pair.  IODstVRefNum contains a destination volume identifier. 
  24262. AppleShare 1.0 required that it be an actual volume reference number; however, on
  24263. future versions it can be a WDRefNum.  The destination pathname is determined by the
  24264. ioNewName/ioNewDirID pair.  IOCopyName may contain an optional string used in renaming
  24265. the file.  If it is non-NIL then the file copy will be renamed to the specified name
  24266. in ioCopyName.
  24267.  
  24268. A fnfErr is returned if the source pathname does not point to an existing file or the
  24269. destination pathname does not point to an existing directory.  An AccessDenied error
  24270. is returned if the user does not have the right to read the source or write to the
  24271. destination.  A dupFnErr is returned if the destination already exists.  A DenyConflict
  24272. error is returned if either the source or destination file could not be opened under
  24273. the access modes described above.
  24274.  
  24275. æKY PBHMoveRename
  24276. æFc Files.h
  24277. æT Function
  24278. æD pascal OSErr PBHMoveRename(HParmBlkPtr paramBlock,Boolean async); 
  24279. æDT OSErr myVariable = PBHMoveRename((HParmBlkPtr) paramBlock,(Boolean) async);
  24280. æRI V-397
  24281. æC 
  24282. Trap macro    _MoveRename
  24283.  
  24284. Parameter block
  24285.   -->    12    ioCompletion  long    optional completion routine ptr
  24286.   <--    16    ioResult      word    error result code
  24287.   -->    18    ioFileName    long    ptr to source pathname
  24288.   -->    22    ioVRefNum     word    source vol identifier
  24289.   -->    28    ioNewName     long    ptr to destination pathname
  24290.   -->    32    ioBuffer      long    ptr to optional name (may be NIL)
  24291.   -->    36    ioNewDirID    long    destination directory ID
  24292.   -->    48    ioDirID       long    source directory ID
  24293.  
  24294. PBHMoveRename allows you to move (not copy) an item and optionally to rename it.  The
  24295. source and destination pathnames must point to the same file server volume.
  24296.  
  24297. IOVRefNum contains a source volume identifier.  The source pathname is specified by
  24298. the ioFileName/ioDirID pair.  The destination pathname is specified by the ioNewName/ioNewDirID
  24299. pair.  IOBuffer may contain an optional string used in renaming the item.  If it is
  24300. non-NIL then the moved object will be renamed to the specified name in ioBuffer.
  24301.  
  24302. A fnfErr is returned if the source pathname does not point to an existing object.  An
  24303. AccessDenied error is returned if the user does not have the right to move the object.
  24304.  A dupFnErr is returned if the destination already exists.  A badMovErr is returned
  24305. if an attempt is made to move a directory into one of its descendent directories.
  24306.  
  24307. æKY PBHOpenDeny
  24308. æFc Files.h
  24309. æT Function
  24310. æD pascal OSErr PBHOpenDeny(HParmBlkPtr paramBlock,Boolean async); 
  24311. æDT OSErr myVariable = PBHOpenDeny((HParmBlkPtr) paramBlock,(Boolean) async);
  24312. æRI V-398
  24313. æC 
  24314. Trap macro    _OpenDeny
  24315.  
  24316. Parameter block
  24317.   -->    12    ioCompletion  long    optional completion routine ptr
  24318.   <--    16    ioResult      word    error result code
  24319.   -->    18    ioFileName    long    ptr to pathname
  24320.   -->    22    ioVRefNum     word    vol identifier
  24321.   <--    24    ioRefNum      word    file refNum
  24322.   -->    26    ioDenyModes   word    access rights data
  24323.   -->    48    ioDirID       long    directory ID
  24324.  
  24325. PBHOpenDeny opens a file’s data fork under specific access rights.  It creates an
  24326. access path to the file having the name pointed to by ioFileName/ioDirID.  The path
  24327. reference number is returned in ioRefNum.
  24328.  
  24329. IODenyModes contains a word of access rights information.  The format for these
  24330. access rights is:
  24331.  
  24332.     bits    15–6    Reserved—should be cleared.
  24333.             5       If set, other writers are denied access.
  24334.             4       If set, other readers are denied access.
  24335.             3–2     Reserved—should be cleared.
  24336.             1       If set, write permission requested.
  24337.             0       If set, read permission requested.
  24338.  
  24339. A fnfErr is returned if the input specification does not point to an existing file. 
  24340. A permErr is returned if the file is already open and you cannot open it under the
  24341. deny modes that you have specified.  An opWrErr is returned if you have asked for
  24342. write permission and the file is already opened by you for write.  The already opened
  24343. path reference number is returned in ioRefNum.  An AccessDenied error is returned if
  24344. you do not have the right to access the file.
  24345.  
  24346. æKY PBHOpenRFDeny
  24347. æFc Files.h
  24348. æT Function
  24349. æD pascal OSErr PBHOpenRFDeny(HParmBlkPtr paramBlock,Boolean async); 
  24350. æDT OSErr myVariable = PBHOpenRFDeny((HParmBlkPtr) paramBlock,(Boolean) async);
  24351. æRI V-398
  24352. æC 
  24353. Trap macro    _OpenRFDeny
  24354.  
  24355. Parameter block
  24356.   -->    12    ioCompletion  long    optional completion routine ptr
  24357.   <--    16    ioResult      word    error result code
  24358.   -->    18    ioFileName    long    ptr to pathname
  24359.   -->    22    ioVRefNum     word    vol identifier
  24360.   <--    24    ioRefNum      word    file refNum
  24361.   -->    26    ioDenyModes   word    access rights data
  24362.   -->    48    ioDirID       long    directory ID
  24363.  
  24364. PBHOpenRFDeny opens a file’s resource fork under specific access rights.
  24365. It creates an access path to the file having the name pointed to by
  24366. ioFileName/ioDirID.  The path reference number is returned in ioRefNum.  The format
  24367. of the access rights data contained in ioDenyModes is described under the OpenDeny
  24368. call.
  24369.  
  24370. A fnfErr is returned if the input specification does not point to an existing file. 
  24371. A permErr is returned if the file is already open and you cannot open it under the
  24372. deny modes that you have specified.  An opWrErr is returned if you have asked for
  24373. write permission and the file is already opened by you for write.  The already-opened
  24374. path reference number is returned in ioRefNum.  An AccessDenied error is returned if
  24375. you do not have the right to access the file.
  24376.  
  24377. æKY PBOpen
  24378. æFc Files.h
  24379. æT Function
  24380. æD pascal OSErr PBOpen(ParmBlkPtr paramBlock,Boolean async); 
  24381. æDT OSErr myVariable = PBOpen((ParmBlkPtr) paramBlock,(Boolean) async);
  24382. æRI II-108
  24383. æC 
  24384. Trap macro    _Open
  24385.  
  24386. Parameter block
  24387.   -->    12    ioCompletion  pointer
  24388.   <--    16    ioResult      word
  24389.   -->    18    ioNamePtr     pointer
  24390.   -->    22    ioVRefNum     word
  24391.   <--    24    ioRefNum      word
  24392.   -->    26    ioVersNum     byte
  24393.   -->    27    ioPermssn     byte
  24394.   -->    28    ioMisc        pointer
  24395.  
  24396. PBOpen creates an access path to the file having the name pointed to by ioNamePtr
  24397. (and on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum.
  24398. A path reference number is returned in ioRefNum.
  24399.  
  24400. IOMisc either points to a portion of memory (522 bytes) to be used as the access
  24401. path’s buffer, or is NIL if you want the volume buffer to be used instead.
  24402.  
  24403. Warning:  All access paths to a single file that’s opened multiple times
  24404.           should share the same buffer so that they will read and write
  24405.           the same data.
  24406.  
  24407. IOPermssn specifies the path’s read/write permission. A path can be opened for writing
  24408. even if it accesses a file on a locked volume, and an error won’t be returned until a
  24409. PBWrite, PBSetEOF, or PBAllocate call is made.
  24410.  
  24411. If you attempt to open a locked file for writing, PBOpen will return permErr as its
  24412. function result. If you request exclusive read/write permission but another access
  24413. path already has write permission (whether write only, exclusive
  24414. read/write, or shared read/write), PBOpen will return the reference number of the
  24415. existing access path in ioRefNum and opWrErr as its function result. Similarly, if
  24416. you request shared read/write permission but another access path already has exclusive
  24417. read/write permission, PBOpen will return the reference number of the access path in
  24418. ioRefNum and opWrErr as its function result.
  24419.  
  24420. Result codes    noErr     No error
  24421.                 bdNamErr  Bad file name
  24422.                 extFSErr  External file system
  24423.                 fnfErr    File not found
  24424.                 ioErr     I/O error
  24425.                 nsvErr    No such volume
  24426.                 opWrErr   File already open for writing
  24427.                 permErr   Attempt to open locked file for writing
  24428.                 tmfoErr   Too many files open
  24429.  
  24430. æKY PBClose
  24431. æFc Files.h
  24432. æT Function
  24433. æD pascal OSErr PBClose(ParmBlkPtr paramBlock,Boolean async); 
  24434. æDT OSErr myVariable = PBClose((ParmBlkPtr) paramBlock,(Boolean) async);
  24435. æRI II-114
  24436. æC 
  24437. Trap macro     _Close
  24438.  
  24439. Parameter block
  24440.   -->    12    ioCompletion  pointer
  24441.   <--    16    ioResult      word
  24442.   -->    24    ioRefNum      word
  24443.  
  24444. PBClose writes the contents of the access path buffer specified by ioRefNum to the
  24445. volume and removes the access path.
  24446.  
  24447. Warning:  Some information stored on the volume won’t be correct
  24448.           until PBFlushVol is called.
  24449.  
  24450. Result codes    noErr     No error
  24451.                 extFSErr  External file system
  24452.                 fnfErr    File not found
  24453.                 fnOpnErr  File not open
  24454.                 ioErr     I/O error
  24455.                 nsvErr    No such volume
  24456.                 rfNumErr  Bad reference number
  24457.  
  24458. æKY PBRead
  24459. æFc Files.h
  24460. æT Function
  24461. æD pascal OSErr PBRead(ParmBlkPtr paramBlock,Boolean async); 
  24462. æDT OSErr myVariable = PBRead((ParmBlkPtr) paramBlock,(Boolean) async);
  24463. æRT 187
  24464. æRI II-110
  24465. æC  
  24466. Trap macro    _Read
  24467.  
  24468. Parameter block
  24469.   -->    12    ioCompletion  pointer
  24470.   <--    16    ioResult      word
  24471.   -->    24    ioRefNum      word
  24472.   -->    32    ioBuffer      pointer
  24473.   -->    36    ioReqCount    long word
  24474.   <--    40    ioActCount    long word
  24475.   -->    44    ioPosMode     word
  24476.   <->    46    ioPosOffset   long word
  24477.  
  24478. PBRead attempts to read ioReqCount bytes from the open file whose access path is
  24479. specified by ioRefNum, and transfer them to the data buffer pointed to by ioBuffer.
  24480. The position of the mark is specified by ioPosMode and ioPosOffset. If you try to
  24481. read past the logical end-of-file, PBRead moves the mark to the end-of-file and
  24482. returns eofErr as its function result. After the read is completed, the mark is
  24483. returned in ioPosOffset and the number of bytes actually read is returned in ioActCount.
  24484.  
  24485. Result codes    noErr     No error
  24486.                 eofErr    End-of-file
  24487.                 extFSErr  External file system
  24488.                 fnOpnErr  File not open
  24489.                 ioErr     I/O error
  24490.                 paramErr  Negative ioReqCount
  24491.                 rfNumErr  Bad reference number
  24492.  
  24493. æKY PBWrite
  24494. æFc Files.h
  24495. æT Function
  24496. æD pascal OSErr PBWrite(ParmBlkPtr paramBlock,Boolean async); 
  24497. æDT OSErr myVariable = PBWrite((ParmBlkPtr) paramBlock,(Boolean) async);
  24498. æRT 187
  24499. æRI II-110
  24500. æC 
  24501.  
  24502. •••Refer to Technical Note #187:•••
  24503.  
  24504. Trap macro    _Write
  24505.  
  24506. Parameter block
  24507.   -->    12    ioCompletion  pointer
  24508.   <--    16    ioResult      word
  24509.   -->    24    ioRefNum      word
  24510.   -->    32    ioBuffer      pointer
  24511.   -->    36    ioReqCount    long word
  24512.   <--    40    ioActCount    long word
  24513.   -->    44    ioPosMode     word
  24514.   <->    46    ioPosOffset   long word
  24515.  
  24516. PBWrite takes ioReqCount bytes from the buffer pointed to by ioBuffer and attempts to
  24517. write them to the open file whose access path is specified by ioRefNum. The position
  24518. of the mark is specified by ioPosMode and ioPosOffset. After the write is completed,
  24519. the mark is returned in ioPosOffset and the number of bytes actually written is
  24520. returned in ioActCount.
  24521.  
  24522. Result codes    noErr      No error
  24523.                 dskFulErr  Disk full
  24524.                 fLckdErr   File locked
  24525.                 fnOpnErr   File not open
  24526.                 ioErr      I/O error
  24527.                 paramErr   Negative ioReqCount
  24528.                 posErr     Attempt to position before start of file
  24529.                 rfNumErr   Bad reference number
  24530.                 vLckdErr   Software volume lock
  24531.                 wPrErr     Hardware volume lock
  24532.                 wrPermErr  Read/write permission doesn’t allow writing
  24533.  
  24534. æKY PBGetVInfo
  24535. æFc Files.h
  24536. æT Function
  24537. æD pascal OSErr PBGetVInfo(ParmBlkPtr paramBlock,Boolean async); 
  24538. æDT OSErr myVariable = PBGetVInfo((ParmBlkPtr) paramBlock,(Boolean) async);
  24539. æRT 24, 44, 157
  24540. æRI II-104, IV-129, N24-1, N44-2, N157
  24541. æC 
  24542. Trap macro    _GetVolInfo
  24543.  
  24544. Parameter block
  24545.   -->    12    ioCompletion  pointer
  24546.   <--    16    ioResult      word
  24547.   <->    18    ioNamePtr     pointer
  24548.   <->    22    ioVRefNum     word
  24549.   -->    28    ioVolIndex    word
  24550.   <--    30    ioVCrDate     long word
  24551.   <--    34    ioVLsBkUp     long word
  24552.   <--    38    ioVAtrb       word
  24553.   <--    40    ioVNmFls      word
  24554.   <--    42    ioVDirSt      word
  24555.   <--    44    ioVBlLn       word
  24556.   <--    46    ioVNmAlBlks   word
  24557.   <--    48    ioVAlBlkSiz   long word
  24558.   <--    52    ioVClpSiz     long word
  24559.   <--    56    ioAlBlSt      word
  24560.   <--    58    ioVNxtFNum    long word
  24561.   <--    62    ioVFrBlk      word
  24562.  
  24563. PBGetVInfo returns information about the specified volume. If ioVolIndex is positive,
  24564. the File Manager attempts to use it to find the volume; for instance, if ioVolIndex
  24565. is 2, the File Manager will attempt to access the second mounted volume. If ioVolIndex
  24566. is negative, the File Manager uses ioNamePtr and ioVRefNum in the standard way (described
  24567. in the section “Specifying Volumes, Directories, and Files”) to determine which
  24568. volume. If ioVolIndex is 0, the File Manager attempts to access the volume by using
  24569. ioVRefNum only. The volume reference number is returned in ioVRefNum, and a pointer
  24570. to the volume name is returned in ioNamePtr (unless ioNamePtr is NIL).
  24571.  
  24572. If a working directory reference number is passed in ioVRefNum (or if the default
  24573. directory is a subdirectory), the number of files and directories in the specified
  24574. directory (the directory’s valence) will be returned in ioVNmFls. Also, the volume
  24575. reference number won’t be returned; ioVRefNum will still contain the working directory
  24576. reference number.
  24577.  
  24578. Warning:  IOVNmAlBlks and ioVFrBlks, which are actually unsigned integers,
  24579.           are clipped to 31744 ($7C00) regardless of the size of the volume.
  24580.  
  24581. Result codes    noErr       No error
  24582.                 nsvErr      No such volume
  24583.                 paramErr    No default volume
  24584.  
  24585. æKY PBGetVol
  24586. æFc Files.h
  24587. æT Function
  24588. æD pascal OSErr PBGetVol(ParmBlkPtr paramBlock,Boolean async); 
  24589. æDT OSErr myVariable = PBGetVol((ParmBlkPtr) paramBlock,(Boolean) async);
  24590. æRI II-104, IV-131
  24591. æC 
  24592. Trap macro    _GetVol
  24593.  
  24594. Parameter block
  24595.   -->    12    ioCompletion  pointer
  24596.   <--    16    ioResult      word
  24597.   <--    18    ioNamePtr     pointer
  24598.   <--    22    ioVRefNum     word
  24599.  
  24600. PBGetVol returns a pointer to the name of the default volume in ioNamePtr
  24601. (unless ioNamePtr is NIL) and its volume reference number in ioVRefNum. If a default
  24602. directory was set with a previous PBSetVol call, a pointer to its name will be returned
  24603. in ioNamePtr and its working directory reference number in ioVRefNum.
  24604.  
  24605. Result codes    noErr     No error
  24606.                 nsvErr    No default volume
  24607.  
  24608. æKY PBSetVol
  24609. æFc Files.h
  24610. æT Function
  24611. æD pascal OSErr PBSetVol(ParmBlkPtr paramBlock,Boolean async); 
  24612. æDT OSErr myVariable = PBSetVol((ParmBlkPtr) paramBlock,(Boolean) async);
  24613. æRI II-105,  IV-132
  24614. æC 
  24615. Trap macro    _SetVol
  24616.  
  24617. Parameter block
  24618.   -->    12    ioCompletion  pointer
  24619.   <--    16    ioResult      word
  24620.   -->    18    ioNamePtr     pointer
  24621.   -->    22    ioVRefNum     word
  24622.  
  24623. PBSetVol sets the default volume to the mounted volume specified by ioNamePtr or
  24624. ioVRefNum. On hierarchical volumes, PBSetVol also sets the root directory as the
  24625. default directory.
  24626.  
  24627. Result codes    noErr     No error
  24628.                 bdNamErr  Bad volume name
  24629.                 nsvErr    No such volume
  24630.                 paramErr  No default volume
  24631.  
  24632. æKY PBFlushVol
  24633. æFc Files.h
  24634. æT Function
  24635. æD pascal OSErr PBFlushVol(ParmBlkPtr paramBlock,Boolean async); 
  24636. æDT OSErr myVariable = PBFlushVol((ParmBlkPtr) paramBlock,(Boolean) async);
  24637. æMM
  24638. æRI II-105, IV-133
  24639. æC 
  24640. Trap macro    _FlushVol
  24641.  
  24642. Parameter block
  24643.   -->    12    ioCompletion  pointer
  24644.   <--    16    ioResult      word
  24645.   -->    18    ioNamePtr     pointer
  24646.   -->    22    ioVRefNum     word
  24647.  
  24648. On the volume specified by ioNamePtr or ioVRefNum, PBFlushVol writes descriptive
  24649. information about the volume, the contents of the associated volume buffer, and all
  24650. access path buffers for the volume (if they’ve changed since the last time PBFlushVol
  24651. was called).
  24652.  
  24653. Note:  The date and time of the last modification to the volume are set
  24654.        when the modification is made, not when the volume is flushed.
  24655.  
  24656. Result codes    noErr     No error
  24657.                 bdNamErr  Bad volume name
  24658.                 extFSErr  External file system
  24659.                 ioErr     I/O error
  24660.                 nsDrvErr  No such drive
  24661.                 nsvErr    No such volume
  24662.                 paramErr  No default volume
  24663.  
  24664. æKY PBCreate
  24665. æFc Files.h
  24666. æT Function
  24667. æD pascal OSErr PBCreate(ParmBlkPtr paramBlock,Boolean async); 
  24668. æDT OSErr myVariable = PBCreate((ParmBlkPtr) paramBlock,(Boolean) async);
  24669. æRI II-107, IV-145
  24670. æC 
  24671. Trap macro    _Create
  24672.  
  24673. Parameter block
  24674.   -->    12    ioCompletion  pointer
  24675.   <--    16    ioResult      word
  24676.   -->    18    ioNamePtr     pointer
  24677.   -->    22    ioVRefNum     word
  24678.   -->    26    ioFVersNum    byte
  24679.  
  24680. PBCreate creates a new file (both forks) having the name pointed to by ioNamePtr (and
  24681. on flat volumes, the version number ioVersNum) on the volume specified by ioVRefNum.
  24682. The new file is unlocked and empty. The date and time of its creation and last modification
  24683. are set to the current date and time. If the file created isn’t temporary (that is,
  24684. if it will exist after the application terminates), the application should call
  24685. PBSetFInfo (after PBCreate) to fill in the information needed by the Finder.
  24686.  
  24687. Assembly-language note:  If a desk accessory creates a file, it should
  24688.                          always create it in the directory containing the
  24689.                          system folder. The working directory reference
  24690.                          number for this directory is stored in the global
  24691.                          variable BootDrive; you can pass it in ioVRefNum.
  24692.  
  24693. Result codes    noErr      No error
  24694.                 bdNamErr   Bad file name
  24695.                 dupFNErr   Duplicate file name and version
  24696.                 dirFulErr  File directory full
  24697.                 extFSErr   External file system
  24698.                 ioErr      I/O error
  24699.                 nsvErr     No such volume
  24700.                 vLckdErr   Software volume lock
  24701.                 wPrErr     Hardware volume lock
  24702.  
  24703. æKY PBDelete
  24704. æFc Files.h
  24705. æT Function
  24706. æD pascal OSErr PBDelete(ParmBlkPtr paramBlock,Boolean async); 
  24707. æDT OSErr myVariable = PBDelete((ParmBlkPtr) paramBlock,(Boolean) async);
  24708. æRI II-119, IV-147
  24709. æC 
  24710. Trap macro    _Delete
  24711.  
  24712. Parameter block
  24713.   -->    12    ioCompletion  pointer
  24714.   <--    16    ioResult      word
  24715.   -->    18    ioNamePtr     pointer
  24716.   -->    22    ioVRefNum     word
  24717.   -->    26    ioFVersNum    byte
  24718.  
  24719. PBDelete removes the closed file having the name pointed to by ioNamePtr (and on flat
  24720. volumes, the version number ioVersNum) from the volume pointed to by ioVRefNum.
  24721. PBHDelete can be used to delete an empty directory as well.
  24722.  
  24723. Note:  This function will delete both forks of the file.
  24724.  
  24725. Result codes    noErr     No error
  24726.                 bdNamErr  Bad file name
  24727.                 extFSErr  External file system
  24728.                 fBsyErr   File busy, directory not empty, or working
  24729.                           directory control block open
  24730.                 fLckdErr  File locked
  24731.                 fnfErr    File not found
  24732.                 nsvErr    No such volume
  24733.                 ioErr     I/O error
  24734.                 vLckdErr  Software volume lock
  24735.                 wPrErr    Hardware volume lock
  24736.  
  24737. æKY PBOpenRF
  24738. æFc Files.h
  24739. æT Function
  24740. æD pascal OSErr PBOpenRF(ParmBlkPtr paramBlock,Boolean async); 
  24741. æDT OSErr myVariable = PBOpenRF((ParmBlkPtr) paramBlock,(Boolean) async);
  24742. æMM
  24743. æRT 74
  24744. æRI II-109, IV-137 
  24745. æC 
  24746. Trap macro    _OpenRF
  24747.  
  24748. Parameter block
  24749.   -->    12    ioCompletion  pointer
  24750.   <--    16    ioResult      word
  24751.   -->    18    ioNamePtr     pointer
  24752.   -->    22    ioVRefNum     word
  24753.   <--    24    ioRefNum      word
  24754.   -->    26    ioVersNum     byte
  24755.   -->    27    ioPermssn     byte
  24756.   -->    28    ioMisc        pointer
  24757.  
  24758. PBOpenRF is identical to PBOpen, except that it opens the file’s resource fork instead
  24759. of its data fork.
  24760.  
  24761. Note:  Normally you should access a file’s resource fork through the
  24762.        routines of the Resource Manager rather than the File Manager.
  24763.        PBOpenRF doesn’t read the resource map into memory; it’s really
  24764.        only useful for block-level operations such as copying files.
  24765.  
  24766. Result codes    noErr     No error
  24767.                 bdNamErr  Bad file name
  24768.                 extFSErr  External file system
  24769.                 fnfErr    File not found
  24770.                 ioErr     I/O error
  24771.                 nsvErr    No such volume
  24772.                 opWrErr   File already open for writing
  24773.                 permErr   Attempt to open locked file for writing
  24774.                 tmfoErr   Too many files open
  24775.  
  24776. æKY PBRename
  24777. æFc Files.h
  24778. æT Function
  24779. æD pascal OSErr PBRename(ParmBlkPtr paramBlock,Boolean async); 
  24780. æDT OSErr myVariable = PBRename((ParmBlkPtr) paramBlock,(Boolean) async);
  24781. æRI II-118, IV-153
  24782. æC 
  24783. Trap macro    _Rename
  24784.  
  24785. Parameter block
  24786.   -->    12    ioCompletion  pointer
  24787.   <--    16    ioResult      word
  24788.   -->    18    ioNamePtr     pointer
  24789.   -->    22    ioVRefNum     word
  24790.   -->    26    ioVersNum     byte
  24791.   -->    28    ioMisc        pointer
  24792.  
  24793. Given a pointer to a file name in ioNamePtr (and on flat volumes, a version number in
  24794. ioVersNum), PBRename changes the name of the file to the name pointed to by ioMisc.
  24795. (If the name pointed to by ioNamePtr contains one or more colons, so must the name
  24796. pointed to by ioMisc.) Access paths currently in use aren’t affected. Given a pointer
  24797. to a volume name in ioNamePtr or a volume reference number in ioVRefNum, it changes
  24798. the name of the volume to the name pointed to by ioMisc. If a volume to be renamed is
  24799. specified by its volume reference number, ioNamePtr can be NIL.
  24800.  
  24801. Warning:  If a volume to be renamed is specified by its volume name, be
  24802.           sure that it ends with a colon, or Rename will consider it a
  24803.           file name.
  24804.  
  24805. Result codes    noErr      No error
  24806.                 bdNamErr   Bad file name
  24807.                 dirFulErr  File directory full
  24808.                 dupFNErr   Duplicate file name and version
  24809.                 extFSErr   External file system
  24810.                 fLckdErr   File locked
  24811.                 fnfErr     File not found
  24812.                 fsRnErr    Problem during rename
  24813.                 ioErr      I/O error
  24814.                 nsvErr     No such volume
  24815.                 paramErr   No default volume
  24816.                 vLckdErr   Software volume lock
  24817.                 wPrErr     Hardware volume lock
  24818.  
  24819. æKY PBGetFInfo
  24820. æFc Files.h
  24821. æT Function
  24822. æD pascal OSErr PBGetFInfo(ParmBlkPtr paramBlock,Boolean async); 
  24823. æDT OSErr myVariable = PBGetFInfo((ParmBlkPtr) paramBlock,(Boolean) async);
  24824. æRT 24
  24825. æRI II-115, IV-148, N24-1, N68-1
  24826. æC 
  24827. Trap macro    _GetFileInfo
  24828.  
  24829. Parameter block
  24830.   -->    12    ioCompletion  pointer
  24831.   <--    16    ioResult      word
  24832.   <->    18    ioNamePtr     pointer
  24833.   -->    22    ioVRefNum     word
  24834.   <--    24    ioFRefNum     word
  24835.   -->    26    ioFVersNum    byte
  24836.   -->    28    ioFDirIndex   word
  24837.   <--    30    ioFlAttrib    byte
  24838.   <--    31    ioFlVersNum   byte
  24839.   <--    32    ioFlFndrInfo  16 bytes
  24840.   <--    48    ioFlNum       long word
  24841.   <--    52    ioFlStBlk     word
  24842.   <--    54    ioFlLgLen     long word
  24843.   <--    58    ioFlPyLen     long word
  24844.   <--    62    ioFlRStBlk    word
  24845.   <--    64    ioFlRLgLen    long word
  24846.   <--    68    ioFlRPyLen    long word
  24847.   <--    72    ioFlCrDat     long word
  24848.   <--    76    ioFlMdDat     long word
  24849.  
  24850. PBGetFInfo returns information about the specified file. If ioFDirIndex is positive,
  24851. the File Manager returns information about the file whose directory index is ioFDirIndex
  24852. on the volume specified by ioVRefNum. (See the section
  24853. “Data Organization on Volumes” if you’re interested in using this method.)
  24854.  
  24855. Note:  If a working directory reference number is specified in ioVRefNum,
  24856.        the File Manager returns information about the file whose directory
  24857.        index is ioFDirIndex in the specified directory.
  24858.  
  24859. If ioFDirIndex is negative or 0, the File Manager returns information about the file
  24860. having the name pointed to by ioNamePtr (and on flat volumes, the version number
  24861. ioFVersNum) on the volume specified by ioVRefNum. If the file is open, the reference
  24862. number of the first access path found is returned in ioFRefNum, and the name of the
  24863. file is returned in ioNamePtr (unless ioNamePtr is NIL).
  24864.  
  24865. Result codes    noErr     No error
  24866.                 bdNamErr  Bad file name
  24867.                 extFSErr  External file system
  24868.                 fnfErr    File not found
  24869.                 ioErr     I/O error
  24870.                 nsvErr    No such volume
  24871.                 paramErr  No default volume
  24872.  
  24873. æKY PBSetFInfo
  24874. æFc Files.h
  24875. æT Function
  24876. æD pascal OSErr PBSetFInfo(ParmBlkPtr paramBlock,Boolean async); 
  24877. æDT OSErr myVariable = PBSetFInfo((ParmBlkPtr) paramBlock,(Boolean) async);
  24878. æRI II-116, IV-150
  24879. æC 
  24880. Trap macro    _SetFileInfo
  24881.  
  24882. Parameter block
  24883.   -->    12    ioCompletion  pointer
  24884.   <--    16    ioResult      word
  24885.   -->    18    ioNamePtr     pointer
  24886.   -->    22    ioVRefNum     word
  24887.   -->    26    ioFVersNum    byte
  24888.   -->    32    ioFlFndrInfo  16 bytes
  24889.   -->    72    ioFlCrDat     long word
  24890.   -->    76    ioFlMdDat     long word
  24891.  
  24892. PBSetFInfo sets information (including the date and time of creation and modification,
  24893. and information needed by the Finder) about the file having the name pointed to by
  24894. ioNamePtr (and on flat volumes, the version number ioFVersNum) on the volume specified
  24895. by ioVRefNum. You should call PBGetFInfo just before PBSetFInfo, so the current
  24896. information is present in the parameter block.
  24897.  
  24898. Result codes    noErr     No error
  24899.                 bdNamErr  Bad file name
  24900.                 extFSErr  External file system
  24901.                 fLckdErr  File locked
  24902.                 fnfErr    File not found
  24903.                 ioErr     I/O error
  24904.                 nsvErr    No such volume
  24905.                 vLckdErr  Software volume lock
  24906.                 wPrErr    Hardware volume lock
  24907.  
  24908. æKY PBSetFLock
  24909. æFc Files.h
  24910. æT Function
  24911. æD pascal OSErr PBSetFLock(ParmBlkPtr paramBlock,Boolean async); 
  24912. æDT OSErr myVariable = PBSetFLock((ParmBlkPtr) paramBlock,(Boolean) async);
  24913. æRI II-116, IV-151
  24914. æC 
  24915. Trap macro    _SetFilLock
  24916.  
  24917. Parameter block
  24918.   -->    12    ioCompletion  pointer
  24919.   <--    16    ioResult      word
  24920.   -->    18    ioNamePtr     pointer
  24921.   -->    22    ioVRefNum     word
  24922.   -->    26    ioFVersNum    byte
  24923.  
  24924. PBSetFLock locks the file having the name pointed to by ioNamePtr (and on flat volumes,
  24925. the version number ioFVersNum) on the volume specified by ioVRefNum. Access paths
  24926. currently in use aren’t affected.
  24927.  
  24928. Result codes    noErr     No error
  24929.                 extFSErr  External file system
  24930.                 fnfErr    File not found
  24931.                 ioErr     I/O error
  24932.                 nsvErr    No such volume
  24933.                 vLckdErr  Software volume lock
  24934.                 wPrErr    Hardware volume lock
  24935.  
  24936. æKY PBRstFLock
  24937. æFc Files.h
  24938. æT Function
  24939. æD pascal OSErr PBRstFLock(ParmBlkPtr paramBlock,Boolean async); 
  24940. æDT OSErr myVariable = PBRstFLock((ParmBlkPtr) paramBlock,(Boolean) async);
  24941. æRI II-117, IV-152
  24942. æC 
  24943. Trap macro    _RstFilLock
  24944.  
  24945. Parameter block
  24946.   -->    12    ioCompletion  pointer
  24947.   <--    16    ioResult      word
  24948.   -->    18    ioNamePtr     pointer
  24949.   -->    22    ioVRefNum     word
  24950.   -->    26    ioFVersNum    byte
  24951.  
  24952. PBRstFLock unlocks the file having the name pointed to by ioNamePtr (and on flat
  24953. volumes, the version number ioFVersNum) on the volume specified by ioVRefNum. Access
  24954. paths currently in use aren’t affected.
  24955.  
  24956. Result codes    noErr     No error
  24957.                 extFSErr  External file system
  24958.                 fnfErr    File not found
  24959.                 ioErr     I/O error
  24960.                 nsvErr    No such volume
  24961.                 vLckdErr  Software volume lock
  24962.                 wPrErr    Hardware volume lock
  24963.  
  24964. æKY PBSetFVers
  24965. æFc Files.h
  24966. æT Function
  24967. æD pascal OSErr PBSetFVers(ParmBlkPtr paramBlock,Boolean async); 
  24968. æDT OSErr myVariable = PBSetFVers((ParmBlkPtr) paramBlock,(Boolean) async);
  24969. æRI II-117, IV-153
  24970. æC 
  24971. Trap macro    _SetFilType
  24972.  
  24973. Parameter block
  24974.   -->    12    ioCompletion  pointer
  24975.   <--    16    ioResult      word
  24976.   -->    18    ioNamePtr     pointer
  24977.   -->    22    ioVRefNum     word
  24978.   -->    26    ioVersNum     byte
  24979.   -->    28    ioMisc        byte
  24980.  
  24981. PBSetFVers has no effect on hierarchical volumes. On flat volumes, PBSetFVers changes
  24982. the version number of the file having the name pointed to by ioNamePtr and version
  24983. number ioVersNum, on the volume specified by ioVRefNum, to the version number stored
  24984. in the high-order byte of ioMisc. Access paths currently in use aren’t affected.
  24985.  
  24986. Result codes    noErr         No error
  24987.                 bdNamErr      Bad file name
  24988.                 dupFNErr      Duplicate file name and version
  24989.                 extFSErr      External file system
  24990.                 fLckdErr      File locked
  24991.                 fnfErr        File not found
  24992.                 nsvErr        No such volume
  24993.                 ioErr         I/O error
  24994.                 paramErr      No default volume
  24995.                 vLckdErr      Software volume lock
  24996.                 wPrErr        Hardware volume lock
  24997.                 wrgVolTypErr  Attempt to perform hierarchical operation
  24998.                               on a flat volume
  24999.  
  25000. æKY PBAllocate
  25001. æFc Files.h
  25002. æT Function
  25003. æD pascal OSErr PBAllocate(ParmBlkPtr paramBlock,Boolean async); 
  25004. æDT OSErr myVariable = PBAllocate((ParmBlkPtr) paramBlock,(Boolean) async);
  25005. æRI II-113, IV-143
  25006. æC 
  25007. Trap macro    _Allocate
  25008.  
  25009. Parameter block
  25010.   -->    12    ioCompletion  pointer
  25011.   <--    16    ioResult      word
  25012.   -->    24    ioRefNum      word
  25013.   -->    36    ioReqCount    long word
  25014.   <--    40    ioActCount    long word
  25015.  
  25016. PBAllocate adds ioReqCount bytes to the open file whose access path is specified by
  25017. ioRefNum, and sets the physical end-of-file to one byte beyond the last block allocated.
  25018. The number of bytes actually allocated is rounded up to the nearest multiple of the
  25019. allocation block size, and returned in ioActCount. If there isn’t enough empty space
  25020. on the volume to satisfy the allocation request, PBAllocate allocates the rest of the
  25021. space on the volume and returns dskFulErr as its function result.
  25022.  
  25023. Note:  Even if the total number of requested bytes is unavailable,
  25024.        PBAllocate will allocate whatever space, contiguous or not, is
  25025.        available. To force the allocation of the entire requested space
  25026.        as a contiguous piece, call PBAllocContig instead.
  25027.  
  25028. Result codes    noErr      No error
  25029.                 dskFulErr  Disk full
  25030.                 fLckdErr   File locked
  25031.                 fnOpnErr   File not open
  25032.                 ioErr      I/O error
  25033.                 rfNumErr   Bad reference number
  25034.                 vLckdErr   Software volume lock
  25035.                 wPrErr     Hardware volume lock
  25036.                 wrPermErr  Read/write permission doesn’t allow writing
  25037.     wrPermErr   Read/write permission doesn’t allow writing
  25038.  
  25039. æKY PBGetEOF
  25040. æFc Files.h
  25041. æT Function
  25042. æD pascal OSErr PBGetEOF(ParmBlkPtr paramBlock,Boolean async); 
  25043. æDT OSErr myVariable = PBGetEOF((ParmBlkPtr) paramBlock,(Boolean) async);
  25044. æRI II-112, IV-142
  25045. æC 
  25046. Trap macro    _GetEOF
  25047.  
  25048. Parameter block
  25049.   -->    12    ioCompletion  pointer
  25050.   <--    16    ioResult      word
  25051.   -->    24    ioRefNum      word
  25052.   <--    28    ioMisc        long word
  25053.  
  25054. PBGetEOF returns, in ioMisc, the logical end-of-file of the open file whose access
  25055. path is specified by ioRefNum.
  25056.  
  25057. Result codes    noErr     No error
  25058.                 extFSErr  External file system
  25059.                 fnOpnErr  File not open
  25060.                 ioErr     I/O error
  25061.                 rfNumErr  Bad reference number
  25062.  
  25063. æKY PBSetEOF
  25064. æFc Files.h
  25065. æT Function
  25066. æD pascal OSErr PBSetEOF(ParmBlkPtr paramBlock,Boolean async); 
  25067. æDT OSErr myVariable = PBSetEOF((ParmBlkPtr) paramBlock,(Boolean) async);
  25068. æRI II-112, IV-142
  25069. æC 
  25070. Trap macro    _SetEOF
  25071.  
  25072. Parameter block
  25073.   -->    12    ioCompletion  pointer
  25074.   <--    16    ioResult      word
  25075.   -->    24    ioRefNum      word
  25076.   -->    28    ioMisc        long word
  25077.  
  25078. PBSetEOF sets the logical end-of-file of the open file, whose access path is specified
  25079. by ioRefNum, to ioMisc. If you attempt to set the logical end-of-file beyond the
  25080. physical end-of-file, another allocation block is added to the file; if there isn’t
  25081. enough space on the volume, no change is made, and PBSetEOF returns dskFulErr as its
  25082. function result. If ioMisc is 0, all space occupied by the file on the volume is
  25083. released.
  25084.  
  25085. Result codes    noErr      No error
  25086.                 dskFulErr  Disk full
  25087.                 extFSErr   External file system
  25088.                 fLckdErr   File locked
  25089.                 fnOpnErr   File not open
  25090.                 ioErr      I/O error
  25091.                 rfNumErr   Bad reference number
  25092.                 vLckdErr   Software volume lock
  25093.                 wPrErr     Hardware volume lock
  25094.                 wrPermErr  Read/write permission doesn’t allow writing
  25095.  
  25096. æKY PBGetFPos
  25097. æFc Files.h
  25098. æT Function
  25099. æD pascal OSErr PBGetFPos(ParmBlkPtr paramBlock,Boolean async); 
  25100. æDT OSErr myVariable = PBGetFPos((ParmBlkPtr) paramBlock,(Boolean) async);
  25101. æRI II-111, IV-141
  25102. æC 
  25103. Trap macro    _GetFPos
  25104.  
  25105. Parameter block
  25106.   -->    12    ioCompletion  pointer
  25107.   <--    16    ioResult      word
  25108.   -->    24    ioRefNum      word
  25109.   <--    36    ioReqCount    long word
  25110.   <--    40    ioActCount    long word
  25111.   <--    44    ioPosMode     word
  25112.   <--    46    ioPosOffset   long word
  25113.  
  25114. PBGetFPos returns, in ioPosOffset, the mark of the open file whose access path is
  25115. specified by ioRefNum. It sets ioReqCount, ioActCount, and ioPosMode to 0.
  25116.  
  25117. Result codes    noErr     No error
  25118.                 extFSErr  External file system
  25119.                 fnOpnErr  File not open
  25120.                 gfpErr    Error during GetFPos
  25121.                 ioErr     I/O error
  25122.                 rfNumErr  Bad reference number
  25123.  
  25124. æKY PBSetFPos
  25125. æFc Files.h
  25126. æT Function
  25127. æD pascal OSErr PBSetFPos(ParmBlkPtr paramBlock,Boolean async); 
  25128. æDT OSErr myVariable = PBSetFPos((ParmBlkPtr) paramBlock,(Boolean) async);
  25129. æRI II-111, IV-141
  25130. æC 
  25131. Trap macro    _SetFPos
  25132.  
  25133. Parameter block
  25134.   -->    12    ioCompletion  pointer
  25135.   <--    16    ioResult      word
  25136.   -->    24    ioRefNum      word
  25137.   -->    44    ioPosMode     word
  25138.   <->    46    ioPosOffset   long word
  25139.  
  25140. PBSetFPos sets the mark of the open file whose access path is specified by ioRefNum
  25141. to the position specified by ioPosMode and ioPosOffset. The position at which the
  25142. mark is actually set is returned in ioPosOffset. If you try to set the mark past the
  25143. logical end-of-file, PBSetFPos moves the mark to the end-of-file and returns eofErr
  25144. as its function result.
  25145.  
  25146. Result codes    noErr     No error
  25147.                 eofErr    End-of-file
  25148.                 extFSErr  External file system
  25149.                 fnOpnErr  File not open
  25150.                 ioErr     I/O error
  25151.                 posErr    Attempt to position before start of file
  25152.                 rfNumErr  Bad reference number
  25153.  
  25154. æKY PBFlushFile
  25155. æFc Files.h
  25156. æT Function
  25157. æD pascal OSErr PBFlushFile(ParmBlkPtr paramBlock,Boolean async); 
  25158. æDT OSErr myVariable = PBFlushFile((ParmBlkPtr) paramBlock,(Boolean) async);
  25159. æRI II-114, IV-144
  25160. æC 
  25161. Trap macro    _FlushFile
  25162.  
  25163. Parameter block
  25164.   -->    12    ioCompletion  pointer
  25165.   <--    16    ioResult      word
  25166.   -->    24    ioRefNum      word
  25167.  
  25168. PBFlushFile writes the contents of the access path buffer indicated by ioRefNum to
  25169. the volume, and updates the file’s entry in the file directory (or in the file catalog,
  25170. in the case of hierarchical volumes).
  25171.  
  25172. Warning:  Some information stored on the volume won’t be correct
  25173.           until PBFlushVol is called.
  25174.  
  25175. Result codes    noErr      No error
  25176.                 extFSErr   External file system
  25177.                 fnfErr     File not found
  25178.                 fnOpnErr   File not open
  25179.                 ioErr      I/O error
  25180.                 nsvErr     No such volume
  25181.                 rfNumErr   Bad reference number
  25182.  
  25183. æKY PBMountVol
  25184. æFc Files.h
  25185. æT Function
  25186. æD pascal OSErr PBMountVol(ParmBlkPtr paramBlock); 
  25187. æDT OSErr myVariable = PBMountVol((ParmBlkPtr) paramBlock);
  25188. æMM
  25189. æRT 134
  25190. æRI II-103, IV-128
  25191. æC 
  25192. »Accessing Volumes
  25193.  
  25194. To get the volume reference number of a volume, given the path reference number of a
  25195. file on that volume, both Pascal and assembly-language programmers can call the
  25196. high-level File Manager function GetVRefNum. Assembly-language programmers may prefer
  25197. calling the function GetFCBInfo (described below in the section “Data Structures in
  25198. Memory”).
  25199.  
  25200. FUNCTION PBMountVol (paramBlock:  ParmBlkPtr) :  OSErr;
  25201.  
  25202. Trap macro    _MountVol
  25203.  
  25204. Parameter block
  25205.   <--    16    ioResult   word
  25206.   <->    22    ioVRefNum  word
  25207.  
  25208. PBMountVol mounts the volume in the drive specified by ioVRefNum, and returns a
  25209. volume reference number in ioVRefNum. If there are no volumes already mounted, this
  25210. volume becomes the default volume. PBMountVol is always executed synchronously.
  25211.  
  25212. Note:  When mounting hierarchical volumes, PBMountVol opens two files
  25213.        needed for maintaining file directory and file mapping information.
  25214.        PBMountVol can fail if there are no access paths available for these
  25215.        two files; it will return tmfoErr as its function result.
  25216.  
  25217. Result codes    noErr        No error
  25218.                 badMDBErr    Bad master directory block
  25219.                 extFSErr     External file system
  25220.                 ioErr        I/O error
  25221.                 memFullErr   Not enough room in heap zone
  25222.                 noMacDskErr  Not a Macintosh disk
  25223.                 nsDrvErr     No such drive
  25224.                 paramErr     Bad drive number
  25225.                 tmfoErr      Too many files open
  25226.                 volOnLinErr  Volume already on-line
  25227.  
  25228. æKY PBUnmountVol
  25229. æFc Files.h
  25230. æT Function
  25231. æD pascal OSErr PBUnmountVol(ParmBlkPtr paramBlock); 
  25232. æDT OSErr myVariable = PBUnmountVol((ParmBlkPtr) paramBlock);
  25233. æRI II-106, IV-134
  25234. æC 
  25235. Trap macro    _UnmountVol
  25236.  
  25237. Parameter block
  25238.   <--    16    ioResult   word
  25239.   -->    18    ioNamePtr  pointer
  25240.   -->    22    ioVRefNum  word
  25241.  
  25242. PBUnmountVol unmounts the volume specified by ioNamePtr or ioVRefNum, by calling
  25243. PBFlushVol to flush the volume, closing all open files on the volume, and releasing
  25244. the memory used for the volume. PBUnmountVol is always executed synchronously.
  25245.  
  25246. Warning:  Don’t unmount the startup volume.
  25247.  
  25248. Note:  Unmounting a volume does not close working directories; to release
  25249.        the memory allocated to a working directory, call PBCloseWD.
  25250.  
  25251. Result codes    noErr     No error
  25252.                 bdNamErr  Bad volume name
  25253.                 extFSErr  External file system
  25254.                 ioErr     I/O error
  25255.                 nsDrvErr  No such drive
  25256.                 nsvErr    No such volume
  25257.                 paramErr  No default volume
  25258.  
  25259. æKY PBEject
  25260. æFc Files.h
  25261. æT Function
  25262. æD pascal OSErr PBEject(ParmBlkPtr paramBlock); 
  25263. æDT OSErr myVariable = PBEject((ParmBlkPtr) paramBlock);
  25264. æMM
  25265. æRI II-107, IV-135
  25266. æC 
  25267. Trap macro    _Eject
  25268.  
  25269. Parameter block
  25270.   -->    12    ioCompletion  pointer
  25271.   <--    16    ioResult      word
  25272.   -->    18    ioNamePtr     pointer
  25273.   -->    22    ioVRefNum     word
  25274.  
  25275. PBEject flushes the volume specified by ioNamePtr or ioVRefNum, places it
  25276. off-line, and then ejects the volume.
  25277.  
  25278. Assembly-language note:  You may invoke the macro _Eject asynchronously;
  25279.                          the first part of the call is executed synchronously,
  25280.                          and the actual ejection is executed asynchronously.
  25281.  
  25282. Result codes    noErr     No error
  25283.                 bdNamErr  Bad volume name
  25284.                 extFSErr  External file system
  25285.                 ioErr     I/O error
  25286.                 nsDrvErr  No such drive
  25287.                 nsvErr    No such volume
  25288.                 paramErr  No default volume
  25289.  
  25290. æKY PBOffLine
  25291. æFc Files.h
  25292. æT Function
  25293. æD pascal OSErr PBOffLine(ParmBlkPtr paramBlock); 
  25294. æDT OSErr myVariable = PBOffLine((ParmBlkPtr) paramBlock);
  25295. æMM
  25296. æRI II-106, IV-134
  25297. æC 
  25298. Trap macro    _OffLine
  25299.  
  25300. Parameter block
  25301.   -->    12    ioCompletion  pointer
  25302.   <--    16    ioResult      word
  25303.   -->    18    ioNamePtr     pointer
  25304.   -->    22    ioVRefNum     word
  25305.  
  25306. PBOffLine places off-line the volume specified by ioNamePtr or ioVRefNum, by calling
  25307. PBFlushVol to flush the volume and releasing all the memory used for the volume
  25308. except for the volume control block. PBOffLine is always executed synchronously.
  25309.  
  25310. Result codes    noErr     No error
  25311.                 bdNamErr  Bad volume name
  25312.                 extFSErr  External file system
  25313.                 ioErr     I/O error
  25314.                 nsDrvErr  No such drive
  25315.                 nsvErr    No such volume
  25316.                 paramErr  No default volume
  25317.  
  25318. æKY PBCatSearch
  25319. æFc Files.h
  25320. æT Function
  25321. æD pascal OSErr PBCatSearch(CSParamPtr paramBlock,Boolean async); 
  25322. æDT OSErr myVariable = PBCatSearch((CSParamPtr) paramBlock,(Boolean) async);
  25323. æMM
  25324. æRI VI
  25325. æC 
  25326. Parameter Block
  25327.   Æ   12  ioCompletion  pointer  pointer to completion routine
  25328.   ¨   16  ioResult         word         result code
  25329.   Æ   18  ioNamePtr        pointer      pointer to volume name
  25330.   Æ   22  ioVRefNum        word         vRefNum or WDRefNum
  25331.   Æ   24  FSSpecArrayPtr   pointer      pointer to array of matches
  25332.   Æ   28  ioReqMatchCount  long         maximum match count wanted
  25333.   ¨   32  ioActMatchCount  long         actual match count 
  25334.   Æ   36  ioSpecBits       long         enable bits for fields in ioSpecs
  25335.   Æ   40  ioSpec1          CinfoPBPtr   values and lower bounds
  25336.   Æ   44  ioSpec2          CinfoPBPtr   masks and upper bounds
  25337.   Æ   48  ioSearchTime     long         maximum elapsed search time
  25338.   Æ   52  ioCatPosition    CatPosition  current catalog position
  25339.   Æ   56  ioRBuffer        pointer      pointer to optional read buffer
  25340.   Æ   60  ioRBufLen        long         length of optional read buffer
  25341.  
  25342. PBCatSearch searches the volume you specify in the parameter block for files
  25343. that match two coordinated sets of selection criteria. PBCatSearch returns the
  25344. names and directory IDs for the files and directories that match the criteria in
  25345. an array of IDs and names.
  25346.  
  25347. Parameter          Meaning
  25348.  
  25349. ioCompletion       A pointer to the completion routine.
  25350.  
  25351. ioResult           Result code.
  25352.  
  25353. ioNamePtr          Pointer to volume name.
  25354.  
  25355. ioFSSpecArrayPtr   A pointer to an array where the file and directory names that
  25356.                    match the selection criteria are returned.
  25357.  
  25358. ioReqMatchCount    The approximate maximum number of matches to return in the
  25359.                    ioReqMatchCount field. Use this field to avoid a possible
  25360.                    glut of matches for criteria that prove to be too general.
  25361.  
  25362. ioActMatchCount    The number of actual matches found.
  25363.  
  25364. ioSpecBits         The fields of the parameter blocks ioSpec1 and ioSpec2 that
  25365.                    are relevant to the search. See “Searching a Volume” for the
  25366.                    values of ioSpecBits.
  25367.  
  25368. ioSpec1            A pointer to a CInfoPBRec parameter block that contains 
  25369.                    values and the lower bounds of ranges for the fields selected
  25370.                    by ioSpecBits.
  25371.  
  25372. ioSpec2            A pointer to a second CInfoPBRec parameter block that 
  25373.                    contains masks and upper bounds of ranges for the fields 
  25374.                    selected by ioSpecBits.
  25375.  
  25376. ioSearchTime       A time limit on the time taken for a search. Use this field
  25377.                    to limit the run time of a single call to PBCatSearch.
  25378.  
  25379. ioCatPosition      A position in the catalog where searching should begin. Use
  25380.                    this field to keep an index into the catalog when breaking 
  25381.                    PBCatSearch down into a number of shorter searches.
  25382.  
  25383.                    To start at the beginning of the catalog, set ioCatPosition 
  25384.                    to 0. Before exiting after an interrupted search, PBCatSearch
  25385.                    sets it to the next record to be searched. To resume where 
  25386.                    the previous call stopped, pass the output of the previous 
  25387.                    call as input to the next.
  25388.  
  25389. ioRBuffer          A pointer to an optional read buffer. The ioRBuffer and 
  25390.                    ioRBufferLen fields let you specify a part of memory as a 
  25391.                    read buffer, increasing search speed.
  25392.  
  25393. ioRBufLen          The length of the buffer pointed to by ioRBuffer. Buffer
  25394.                    effectiveness varies with models and configurations, but a 32
  25395.                    KB buffer is likely to be optimal. Even a 1 KB buffer 
  25396.                    provides some performance improvement.
  25397.  
  25398. See the section “Using the File Manager” for a more complete description of
  25399. PBCatSearch.
  25400.  
  25401. Result codes
  25402.  
  25403. noErr                No error
  25404. extFSErr             External file system
  25405. ioErr                I/O error
  25406. nsvErr               No such volume
  25407. catalogChangedErr    The catalog has changed and CatPosition may be invalid
  25408. paramErr             Numerous causes
  25409.  
  25410. æKY AddDrive
  25411. æFc Files.h
  25412. æT Function
  25413. æD pascal void AddDrive(short drvrRefNum,short drvNum,DrvQElPtr qEl); 
  25414. æDT AddDrive((short) drvrRefNum,(short) drvNum,(DrvQElPtr) qEl);
  25415. æRT 36, 108 
  25416. æRI N36, N108-1
  25417. æC 
  25418.  
  25419. æKY FSOpen
  25420. æFc Files.h
  25421. æT Function
  25422. æD pascal OSErr FSOpen(const Str255 fileName,short vRefNum,short *refNum); 
  25423. æDT OSErr myVariable = FSOpen((const Str255) fileName,(short) vRefNum,(short *) refNum);
  25424. æRT 102
  25425. æRI II-91, IV-109, P-131, 171
  25426. æC  
  25427. [Not in ROM]
  25428.  
  25429. FSOpen creates an access path to the file having the name fileName on the volume
  25430. specified by vRefNum. A path reference number is returned in refNum. The access
  25431. path’s read/write permission is set to whatever the file’s open permission allows.
  25432.  
  25433. Note:  There’s no guarantee that any bytes have been written until
  25434.        FlushVol is called.
  25435.  
  25436. Result codes    noErr       No error
  25437.                 bdNamErr    Bad file name
  25438.                 extFSErr    External file system
  25439.                 fnfErr      File not found
  25440.                 ioErr       I/O error
  25441.                 nsvErr      No such volume
  25442.                 opWrErr     File already open for writing
  25443.                 tmfoErr     Too many files open
  25444.  
  25445. æKY fsopen
  25446. æFc Files.h
  25447. æT Function
  25448. æD OSErr fsopen(char *fileName,short vRefNum,short *refNum); 
  25449. æDT OSErr myVariable = fsopen((char *) fileName,(short) vRefNum,(short *) refNum);
  25450. æC 
  25451.  
  25452. æKY FSClose
  25453. æFc Files.h
  25454. æT Function
  25455. æD pascal OSErr FSClose(short refNum); 
  25456. æDT OSErr myVariable = FSClose((short) refNum);
  25457. æRT 102
  25458. æRI II-94, IV-112, P-132, 133, 171
  25459. æC  
  25460. [Not in ROM]
  25461.  
  25462. FSClose removes the access path specified by refNum, writes the contents of the
  25463. volume buffer to the volume, and updates the file’s entry in the file directory.
  25464.  
  25465. Note:  There’s no guarantee that any bytes have been written until
  25466.        FlushVol is called.
  25467.  
  25468. Result codes    noErr       No error
  25469.                 extFSErr    External file system
  25470.                 fnfErr      File not found
  25471.                 fnOpnErr    File not open
  25472.                 ioErr       I/O error
  25473.                 nsvErr      No such volume
  25474.                 rfNumErr    Bad reference number
  25475.  
  25476. æKY FSRead
  25477. æFc Files.h
  25478. æT Function
  25479. æD pascal OSErr FSRead(short refNum,long *count,Ptr buffPtr); 
  25480. æDT OSErr myVariable = FSRead((short) refNum,(long *) count,(Ptr) buffPtr);
  25481. æRI IV-109, P-131, 171
  25482. æC  
  25483. [Not in ROM]
  25484.  
  25485. FSRead attempts to read the number of bytes specified by the count parameter from the
  25486. open file whose access path is specified by refNum, and transfer them to the data
  25487. buffer pointed to by buffPtr. The read operation begins at the current mark, so you
  25488. might want to precede this with a call to SetFPos. If you try to read past the logical
  25489. end-of-file, FSRead moves the mark to the end-of-file and returns eofErr as its
  25490. function result. After the read is completed, the number of bytes actually read is
  25491. returned in the count parameter.
  25492.  
  25493. Result codes    noErr       No error
  25494.                 eofErr      End-of-file
  25495.                 extFSErr    External file system
  25496.                 fnOpnErr    File not open
  25497.                 ioErr       I/O error
  25498.                 paramErr    Negative count
  25499.                 rfNumErr    Bad reference number
  25500.  
  25501. æKY FSWrite
  25502. æFc Files.h
  25503. æT Function
  25504. æD pascal OSErr FSWrite(short refNum,long *count,Ptr buffPtr); 
  25505. æDT OSErr myVariable = FSWrite((short) refNum,(long *) count,(Ptr) buffPtr);
  25506. æRI IV-110, P-132, 171
  25507. æC  
  25508. [Not in ROM]
  25509.  
  25510. FSWrite takes the number of bytes specified by the count parameter from the buffer
  25511. pointed to by buffPtr and attempts to write them to the open file whose access path
  25512. is specified by refNum. The write operation begins at the current mark, so you might
  25513. want to precede this with a call to SetFPos. After the write is completed, the number
  25514. of bytes actually written is returned in the count parameter.
  25515.  
  25516. Result codes    noErr        No error
  25517.                 dskFulErr    Disk full
  25518.                 fLckdErr     File locked
  25519.                 fnOpnErr     File not open
  25520.                 ioErr        I/O error
  25521.                 paramErr     Negative count
  25522.                 rfNumErr     Bad reference number
  25523.                 vLckdErr     Software volume lock
  25524.                 wPrErr       Hardware volume lock
  25525.                 wrPermErr    Read/write permission doesn’t allow writing
  25526.  
  25527. æKY GetVInfo
  25528. æFc Files.h
  25529. æT Function
  25530. æD pascal OSErr GetVInfo(short drvNum,StringPtr volName,short *vRefNum,long *freeBytes); 
  25531. æDT OSErr myVariable = GetVInfo((short) drvNum,(StringPtr) volName,(short *) vRefNum,(long *) freeBytes);
  25532. æRT 157
  25533. æRI II-89, IV-107, N157, low-level  II-104, IV-129
  25534. æC 
  25535. »Accessing Volumes
  25536.  
  25537. •••Refer to Technical Note #24:•••
  25538.  
  25539. FUNCTION GetVInfo (drvNum:  INTEGER; volName:  StringPtr; VAR vRefNum:  INTEGER;
  25540.                    VAR freeBytes:  LONGINT) :  OSErr; [Not in ROM]
  25541.  
  25542. •••Refer to Technical Note #157:•••
  25543.  
  25544. GetVInfo returns the name, reference number, and available space (in bytes), in
  25545. volName, vRefNum, and freeBytes, for the volume in the drive specified by drvNum.
  25546.  
  25547. Result codes    noErr       No error
  25548.                 nsvErr      No default volume
  25549.                 paramErr    Bad drive number
  25550.  
  25551. æKY getvinfo
  25552. æFc Files.h
  25553. æT Function
  25554. æD OSErr getvinfo(short drvNum,char *volName,short *vRefNum,long *freeBytes); 
  25555. æDT OSErr myVariable = getvinfo((short) drvNum,(char *) volName,(short *) vRefNum,(long *) freeBytes);
  25556. æC 
  25557.  
  25558. æKY GetFInfo
  25559. æFc Files.h
  25560. æT Function
  25561. æD pascal OSErr GetFInfo(const Str255 fileName,short vRefNum,FInfo *fndrInfo); 
  25562. æDT OSErr myVariable = GetFInfo((const Str255) fileName,(short) vRefNum,(FInfo *) fndrInfo);
  25563. æRI II-95, IV-113
  25564. æC  
  25565. [Not in ROM]
  25566.  
  25567. For the file having the name fileName on the specified volume, GetFInfo returns
  25568. information used by the Finder in fndrInfo (see the section “Information Used by the
  25569. Finder”).
  25570.  
  25571. Result codes    noErr       No error
  25572.                 bdNamErr    Bad file name
  25573.                 extFSErr    External file system
  25574.                 fnfErr      File not found
  25575.                 ioErr       I/O error
  25576.                 nsvErr      No such volume
  25577.                 paramErr    No default volume
  25578.  
  25579. æKY getfinfo
  25580. æFc Files.h
  25581. æT Function
  25582. æD OSErr getfinfo(char *fileName,short vRefNum,FInfo *fndrInfo); 
  25583. æDT OSErr myVariable = getfinfo((char *) fileName,(short) vRefNum,(FInfo *) fndrInfo);
  25584. æC 
  25585.  
  25586. æKY GetVol
  25587. æFc Files.h
  25588. æT Function
  25589. æD pascal OSErr GetVol(StringPtr volName,short *vRefNum); 
  25590. æDT OSErr myVariable = GetVol((StringPtr) volName,(short *) vRefNum);
  25591. æRT 77,140
  25592. æRI N77-2, N140 high-level  II-89, IV-107  low-level  II-104, IV-131
  25593. æC  
  25594. [Not in ROM]
  25595.  
  25596. GetVol returns the name of the default volume in volName and its volume reference
  25597. number in vRefNum.
  25598.  
  25599. Result codes    noErr     No error
  25600.                 nsvErr    No such volume
  25601.  
  25602. æKY getvol
  25603. æFc Files.h
  25604. æT Function
  25605. æD OSErr getvol(char *volName,short *vRefNum); 
  25606. æDT OSErr myVariable = getvol((char *) volName,(short *) vRefNum);
  25607. æC 
  25608.  
  25609. æKY SetVol
  25610. æFc Files.h
  25611. æT Function
  25612. æD pascal OSErr SetVol(StringPtr volName,short vRefNum); 
  25613. æDT OSErr myVariable = SetVol((StringPtr) volName,(short) vRefNum);
  25614. æRI II-89, IV-107  low-level II-105, IV-132
  25615. æC  
  25616. [Not in ROM]
  25617.  
  25618. SetVol sets the default volume to the mounted volume specified by volName or vRefNum.
  25619.  
  25620. Result codes    noErr       No error
  25621.                 bdNamErr    Bad volume name
  25622.                 nsvErr      No such volume
  25623.                 paramErr    No default volume
  25624.  
  25625. æKY setvol
  25626. æFc Files.h
  25627. æT Function
  25628. æD OSErr setvol(char *volName,short vRefNum); 
  25629. æDT OSErr myVariable = setvol((char *) volName,(short) vRefNum);
  25630. æC 
  25631.  
  25632. æKY UnmountVol
  25633. æFc Files.h
  25634. æT Function
  25635. æD pascal OSErr UnmountVol(StringPtr volName,short vRefNum); 
  25636. æDT OSErr myVariable = UnmountVol((StringPtr) volName,(short) vRefNum);
  25637. æRT 180
  25638. æRI II-90, IV-108  low-level II-106, IV-134
  25639. æC  
  25640. [Not in ROM]
  25641.  
  25642. UnmountVol unmounts the volume specified by volName or vRefNum, by calling FlushVol
  25643. to flush the volume buffer, closing all open files on the volume, and releasing the
  25644. memory used for the volume.
  25645.  
  25646. Warning:  Don’t unmount the startup volume.
  25647.  
  25648. Result codes    noErr        No error
  25649.                 bdNamErr     Bad volume name
  25650.                 extFSErr     External file system
  25651.                 ioErr        I/O error
  25652.                 nsDrvErr     No such drive
  25653.                 nsvErr       No such volume
  25654.                 paramErr     No default volume
  25655.  
  25656. æKY unmountvol
  25657. æFc Files.h
  25658. æT Function
  25659. æD OSErr unmountvol(char *volName,short vRefNum); 
  25660. æDT OSErr myVariable = unmountvol((char *) volName,(short) vRefNum);
  25661. æC 
  25662.  
  25663. æKY Eject
  25664. æFc Files.h
  25665. æT Function
  25666. æD pascal OSErr Eject(StringPtr volName,short vRefNum); 
  25667. æDT OSErr myVariable = Eject((StringPtr) volName,(short) vRefNum);
  25668. æMM
  25669. æRI II-90, IV-108 low-level  II-107, IV-135
  25670. æC  
  25671. [Not in ROM]
  25672.  
  25673. Eject flushes the volume specified by volName or vRefNum, places it off-line, and
  25674. then ejects the volume.
  25675.  
  25676. Result codes    noErr       No error
  25677.                 bdNamErr    Bad volume name
  25678.                 extFSErr    External file system
  25679.                 ioErr       I/O error
  25680.                 nsDrvErr    No such drive
  25681.                 nsvErr      No such volume
  25682.                 paramErr    No default volume
  25683.  
  25684. æKY eject
  25685. æFc Files.h
  25686. æT Function
  25687. æD OSErr eject(char *volName,short vRefNum); 
  25688. æDT OSErr myVariable = eject((char *) volName,(short) vRefNum);
  25689. æC 
  25690.  
  25691. æKY FlushVol
  25692. æFc Files.h
  25693. æT Function
  25694. æD pascal OSErr FlushVol(StringPtr volName,short vRefNum); 
  25695. æDT OSErr myVariable = FlushVol((StringPtr) volName,(short) vRefNum);
  25696. æMM
  25697. æRI P-132, 133 high-level  II-89, IV-108 low-level  II-105, IV-133
  25698. æC  
  25699. [Not in ROM]
  25700.  
  25701. On the volume specified by volName or vRefNum, FlushVol writes the contents of the
  25702. associated volume buffer and descriptive information about the volume (if they’ve
  25703. changed since the last time FlushVol was called).
  25704.  
  25705. Result codes    noErr       No error
  25706.                 bdNamErr    Bad volume name
  25707.                 extFSErr    External file system
  25708.                 ioErr       I/O error
  25709.                 nsDrvErr    No such drive
  25710.                 nsvErr      No such volume
  25711.                 paramErr    No default volume
  25712.  
  25713. æKY flushvol
  25714. æFc Files.h
  25715. æT Function
  25716. æD OSErr flushvol(char *volName,short vRefNum); 
  25717. æDT OSErr myVariable = flushvol((char *) volName,(short) vRefNum);
  25718. æC 
  25719.  
  25720. æKY Create
  25721. æFc Files.h
  25722. æT Function
  25723. æD pascal OSErr Create(const Str255 fileName,short vRefNum,OSType creator,
  25724.     OSType fileType); 
  25725. æDT OSErr myVariable = Create((const Str255) fileName,(short) vRefNum,(OSType) creator,()
  25726.     OSType fileType);
  25727. æRI II-90, IV-112 low-level II-107, IV-145
  25728. æC  
  25729. [Not in ROM]
  25730.  
  25731. Create creates a new file (both forks) with the specified name, file type, and creator
  25732. on the specified volume. (File type and creator are discussed in the Finder Interface
  25733. chapter.) The new file is unlocked and empty. The date and time of its creation and
  25734. last modification are set to the current date and time.
  25735.  
  25736. Result codes    noErr        No error
  25737.                 bdNamErr     Bad file name
  25738.                 dupFNErr     Duplicate file name and version
  25739.                 dirFulErr    File directory full
  25740.                 extFSErr     External file system
  25741.                 ioErr        I/O error
  25742.                 nsvErr       No such volume
  25743.                 vLckdErr     Software volume lock
  25744.                 wPrErr       Hardware volume lock
  25745.  
  25746. æKY create
  25747. æFc Files.h
  25748. æT Function
  25749. æD OSErr create(char *fileName,short vRefNum,OSType creator,OSType fileType); 
  25750. æDT OSErr myVariable = create((char *) fileName,(short) vRefNum,(OSType) creator,(OSType) fileType);
  25751. æRI II-90, IV-112 low-level II-107, IV-145
  25752. æC     Create creates a new file (both forks) with the specified name,
  25753. file type, and creator on the specified volume. (File type and
  25754. creator are discussed in the Finder Interface chapter.)
  25755. The new file is unlocked and empty. The date and time of its
  25756. creation and last modification are set to the current date and time.
  25757.  
  25758. Result codes
  25759.  
  25760.     noErr       No error
  25761.     bdNamErr    Bad file name
  25762.     dupFNErr    Duplicate file name and version
  25763.     dirFulErr   File directory full
  25764.     extFSErr    External file system
  25765.     ioErr       I/O error
  25766.     nsvErr      No such volume
  25767.     vLckdErr    Software volume lock
  25768.     wPrErr      Hardware volume lock
  25769.  
  25770. æKY FSDelete
  25771. æFc Files.h
  25772. æT Function
  25773. æD pascal OSErr FSDelete(const Str255 fileName,short vRefNum); 
  25774. æDT OSErr myVariable = FSDelete((const Str255) fileName,(short) vRefNum);
  25775. æRI II-97, IV-113
  25776. æC 
  25777. [Not in ROM]
  25778.  
  25779. FSDelete removes the closed file having the name fileName from the specified volume.
  25780.  
  25781. Note:  This function will delete both forks of a file.
  25782.  
  25783. Result codes    noErr       No error
  25784.                 bdNamErr    Bad file name
  25785.                 extFSErr    External file system
  25786.                 fBsyErr     File busy
  25787.                 fLckdErr    File locked
  25788.                 fnfErr      File not found
  25789.                 ioErr       I/O error
  25790.                 nsvErr      No such volume
  25791.                 vLckdErr    Software volume lock
  25792.                 wPrErr      Hardware volume lock
  25793.  
  25794. æKY fsdelete
  25795. æFc Files.h
  25796. æT Function
  25797. æD OSErr fsdelete(char *fileName,short vRefNum); 
  25798. æDT OSErr myVariable = fsdelete((char *) fileName,(short) vRefNum);
  25799. æC 
  25800.  
  25801. æKY OpenRF
  25802. æFc Files.h
  25803. æT Function
  25804. æD pascal OSErr OpenRF(const Str255 fileName,short vRefNum,short *refNum); 
  25805. æDT OSErr myVariable = OpenRF((const Str255) fileName,(short) vRefNum,(short *) refNum);
  25806. æRT 74
  25807. æRI II-91, IV-109 low-level II-109, IV-137
  25808. æC  
  25809. [Not in ROM]
  25810.  
  25811. OpenRF is similar to FSOpen; the only difference is that OpenRF opens the resource
  25812. fork of the specified file rather than the data fork. A path reference number is
  25813. returned in refNum. The access path’s read/write permission is set to whatever the
  25814. file’s open permission allows.
  25815.  
  25816. Note:  Normally you should access a file’s resource fork through the
  25817.        routines of the Resource Manager rather than the File Manager.
  25818.        OpenRF doesn’t read the resource map into memory; it’s really
  25819.        only useful for block-level operations such as copying files.
  25820.  
  25821. Result codes    noErr       No error
  25822.                 bdNamErr    Bad file name
  25823.                 extFSErr    External file system
  25824.                 fnfErr      File not found
  25825.                 ioErr       I/O error
  25826.                 nsvErr      No such volume
  25827.                 opWrErr     File already open for writing
  25828.                 tmfoErr     Too many files open
  25829.  
  25830. æKY openrf
  25831. æFc Files.h
  25832. æT Function
  25833. æD OSErr openrf(char *fileName,short vRefNum,short *refNum); 
  25834. æDT OSErr myVariable = openrf((char *) fileName,(short) vRefNum,(short *) refNum);
  25835. æC 
  25836.  
  25837. æKY Rename
  25838. æFc Files.h
  25839. æT Function
  25840. æD pascal OSErr Rename(const Str255 oldName,short vRefNum,const Str255 newName); 
  25841. æDT OSErr myVariable = Rename((const Str255) oldName,(short) vRefNum,(const Str255) newName);
  25842. æRI II-96, IV-114  low-level II-118, IV-153
  25843. æC  
  25844. [Not in ROM]
  25845.  
  25846. Given a file name in oldName, Rename changes the name of the file to newName. Access
  25847. paths currently in use aren’t affected. Given a volume name in oldName or a volume
  25848. reference number in vRefNum, Rename changes the name of the specified volume to
  25849. newName.
  25850.  
  25851. Warning:  If you’re renaming a volume, be sure that both names end with a colon.
  25852.  
  25853. Result codes    noErr        No error
  25854.                 bdNamErr     Bad file name
  25855.                 dirFulErr    Directory full
  25856.                 dupFNErr     Duplicate file name
  25857.                 extFSErr     External file system
  25858.                 fLckdErr     File locked
  25859.                 fnfErr       File not found
  25860.                 fsRnErr      Problem during rename
  25861.                 ioErr        I/O error
  25862.                 nsvErr       No such volume
  25863.                 paramErr     No default volume
  25864.                 vLckdErr     Software volume lock
  25865.                 wPrErr       Hardware volume lock
  25866.  
  25867. æKY fsrename
  25868. æFc Files.h
  25869. æT Function
  25870. æD OSErr fsrename(char *oldName,short vRefNum,char *newName); 
  25871. æDT OSErr myVariable = fsrename((char *) oldName,(short) vRefNum,(char *) newName);
  25872. æRI II-96, IV-114  low-level II-118, IV-153
  25873. æC fsrename is actually the "c" version of the Macintosh ROM call, Rename,
  25874. which uses c strings. It was not named "rename" to avoid conflict 
  25875. with the ANSI call by that name.
  25876.  
  25877. æKY SetFInfo
  25878. æFc Files.h
  25879. æT Function
  25880. æD pascal OSErr SetFInfo(const Str255 fileName,short vRefNum,const FInfo *fndrInfo); 
  25881. æDT OSErr myVariable = SetFInfo((const Str255) fileName,(short) vRefNum,(const FInfo *) fndrInfo);
  25882. æRI II-95, IV-114
  25883. æC  
  25884. [Not in ROM]
  25885.  
  25886. For the file having the name fileName on the specified volume, SetFInfo sets information
  25887. used by the Finder to fndrInfo (see the section “Information Used by the Finder”).
  25888.  
  25889. Result codes    noErr        No error
  25890.                 extFSErr     External file system
  25891.                 fLckdErr     File locked
  25892.                 fnfErr       File not found
  25893.                 ioErr        I/O error
  25894.                 nsvErr       No such volume
  25895.                 vLckdErr     Software volume lock
  25896.                 wPrErr       Hardware volume lock
  25897.  
  25898. æKY setfinfo
  25899. æFc Files.h
  25900. æT Function
  25901. æD OSErr setfinfo(char *fileName,short vRefNum,FInfo *fndrInfo); 
  25902. æDT OSErr myVariable = setfinfo((char *) fileName,(short) vRefNum,(FInfo *) fndrInfo);
  25903. æC 
  25904.  
  25905. æKY SetFLock
  25906. æFc Files.h
  25907. æT Function
  25908. æD pascal OSErr SetFLock(const Str255 fileName,short vRefNum); 
  25909. æDT OSErr myVariable = SetFLock((const Str255) fileName,(short) vRefNum);
  25910. æRI II-95, IV-114
  25911. æC  
  25912. [Not in ROM]
  25913.  
  25914. SetFLock locks the file having the name fileName on the specified volume. Access
  25915. paths currently in use aren’t affected.
  25916.  
  25917. Result codes    noErr       No error
  25918.                 extFSErr    External file system
  25919.                 fnfErr      File not found
  25920.                 ioErr       I/O error
  25921.                 nsvErr      No such volume
  25922.                 vLckdErr    Software volume lock
  25923.                 wPrErr      Hardware volume lock
  25924.  
  25925. æKY setflock
  25926. æFc Files.h
  25927. æT Function
  25928. æD OSErr setflock(char *fileName,short vRefNum); 
  25929. æDT OSErr myVariable = setflock((char *) fileName,(short) vRefNum);
  25930. æC 
  25931.  
  25932. æKY RstFLock
  25933. æFc Files.h
  25934. æT Function
  25935. æD pascal OSErr RstFLock(const Str255 fileName,short vRefNum); 
  25936. æDT OSErr myVariable = RstFLock((const Str255) fileName,(short) vRefNum);
  25937. æRI II-96, IV-114
  25938. æC 
  25939. [Not in ROM]
  25940.  
  25941. RstFLock unlocks the file having the name fileName on the specified volume. Access
  25942. paths currently in use aren’t affected.
  25943.  
  25944. Result codes    noErr       No error
  25945.                 extFSErr    External file system
  25946.                 fnfErr      File not found
  25947.                 ioErr       I/O error
  25948.                 nsvErr      No such volume
  25949.                 vLckdErr    Software volume lock
  25950.                 wPrErr      Hardware volume lock
  25951.  
  25952. æKY rstflock
  25953. æFc Files.h
  25954. æT Function
  25955. æD OSErr rstflock(char *fileName,short vRefNum); 
  25956. æDT OSErr myVariable = rstflock((char *) fileName,(short) vRefNum);
  25957. æC 
  25958.  
  25959. æKY Allocate
  25960. æFc Files.h
  25961. æT Function
  25962. æD pascal OSErr Allocate(short refNum,long *count); 
  25963. æDT OSErr myVariable = Allocate((short) refNum,(long *) count);
  25964. æRI IV-143
  25965. æC  
  25966. [Not in ROM]
  25967.  
  25968. Allocate adds the number of bytes specified by the count parameter to the open file
  25969. whose access path is specified by refNum, and sets the physical end-of-file to one
  25970. byte beyond the last block allocated. The number of bytes actually allocated is
  25971. rounded up to the nearest multiple of the allocation block size, and returned in the
  25972. count parameter. If there isn’t enough empty space on the volume to satisfy the
  25973. allocation request, Allocate allocates the rest of the space on the volume and returns
  25974. dskFulErr as its function result.
  25975.  
  25976. Result codes    noErr        No error
  25977.                 dskFulErr    Disk full
  25978.                 fLckdErr     File locked
  25979.                 fnOpnErr     File not open
  25980.                 ioErr        I/O error
  25981.                 rfNumErr     Bad reference number
  25982.                 vLckdErr     Software volume lock
  25983.                 wPrErr       Hardware volume lock
  25984.                 wrPermErr    Read/write permission doesn’t allow writing
  25985.  
  25986. æKY GetEOF
  25987. æFc Files.h
  25988. æT Function
  25989. æD pascal OSErr GetEOF(short refNum,long *logEOF); 
  25990. æDT OSErr myVariable = GetEOF((short) refNum,(long *) logEOF);
  25991. æRI P-132, 172  high-level  II-93, IV-111 low-level  II-112, IV-142
  25992. æC  
  25993. [Not in ROM]
  25994.  
  25995. GetEOF returns, in logEOF, the logical end-of-file of the open file whose access path
  25996. is specified by refNum.
  25997.  
  25998. Result codes    noErr       No error
  25999.                 extFSErr    External file system
  26000.                 fnOpnErr    File not open
  26001.                 ioErr       I/O error
  26002.                 rfNumErr    Bad reference number
  26003.  
  26004. æKY SetEOF
  26005. æFc Files.h
  26006. æT Function
  26007. æD pascal OSErr SetEOF(short refNum,long logEOF); 
  26008. æDT OSErr myVariable = SetEOF((short) refNum,(long) logEOF);
  26009. æRI P-132, 180 high-level II-93, IV-111  low-level II-112, IV-142
  26010. æC  
  26011. [Not in ROM]
  26012.  
  26013. SetEOF sets the logical end-of-file of the open file whose access path is specified
  26014. by refNum to the position specified by logEOF. If you attempt to set the logical
  26015. end-of-file beyond the physical end-of-file, the physical end-of-file is set to one
  26016. byte beyond the end of the next free allocation block; if there isn’t enough space on
  26017. the volume, no change is made, and SetEOF returns dskFulErr as its function result.
  26018. If logEOF is 0, all space occupied by the file on the volume is released.
  26019.  
  26020. Result codes    noErr        No error
  26021.                 dskFulErr    Disk full
  26022.                 extFSErr     External file system
  26023.                 fLckdErr     File locked
  26024.                 fnOpnErr     File not open
  26025.                 ioErr        I/O error
  26026.                 rfNumErr     Bad reference number
  26027.                 vLckdErr     Software volume lock
  26028.                 wPrErr       Hardware volume lock
  26029.                 wrPermErr    Read/write permission doesn’t allow writing
  26030.  
  26031. æKY GetFPos
  26032. æFc Files.h
  26033. æT Function
  26034. æD pascal OSErr GetFPos(short refNum,long *filePos); 
  26035. æDT OSErr myVariable = GetFPos((short) refNum,(long *) filePos);
  26036. æRI II-92, IV-110  low-level  II-111, IV-141
  26037. æC  
  26038. [Not in ROM]
  26039.  
  26040. GetFPos returns, in filePos, the mark of the open file whose access path is specified
  26041. by refNum.
  26042.  
  26043. Result codes    noErr        No error
  26044.                 extFSErr     External file system
  26045.                 fnOpnErr     File not open
  26046.                 ioErr        I/O error
  26047.                 rfNumErr     Bad reference number
  26048.  
  26049. æKY SetFPos
  26050. æFc Files.h
  26051. æT Function
  26052. æD pascal OSErr SetFPos(short refNum,short posMode,long posOff); 
  26053. æDT OSErr myVariable = SetFPos((short) refNum,(short) posMode,(long) posOff);
  26054. æRI P-131, 132, 180  high-level II-93, IV-110 low-level II-111, IV-141
  26055. æC  
  26056. [Not in ROM]
  26057.  
  26058. SetFPos sets the mark of the open file whose access path is specified by refNum to
  26059. the position specified by posMode and posOff (except when posMode is equal to fsAtMark,
  26060. in which case posOff is ignored). PosMode indicates how to position the mark; it must
  26061. contain one of the following values:
  26062.  
  26063. CONST  fsAtMark     = 0;    {at current mark}
  26064.        fsFromStart  = 1;    {set mark relative to beginning of file}
  26065.        fsFromLEOF   = 2;    {set mark relative to logical end-of-file}
  26066.        fsFromMark   = 3;    {set mark relative to current mark}
  26067.  
  26068. If you specify fsAtMark, posOffset is ignored and the mark is left wherever
  26069. it’s currently positioned. If you choose to set the mark (relative to either the
  26070. beginning of the file, the logical end-of-file, or the current mark), posOffset
  26071. specifies the byte offset from the chosen point (either positive or negative) where
  26072. the mark should be set. If you try to set the mark past the logical end-of-file,
  26073. SetFPos moves the mark to the end-of-file and returns eofErr as its function result.
  26074.  
  26075. Result codes    noErr        No error
  26076.                 eofErr       End-of-file
  26077.                 extFSErr     External file system
  26078.                 fnOpnErr     File not open
  26079.                 ioErr        I/O error
  26080.                 posErr       Attempt to position before start of file
  26081.                 rfNumErr     Bad reference number
  26082.  
  26083. æKY GetVRefNum
  26084. æFc Files.h
  26085. æT Function
  26086. æD pascal OSErr GetVRefNum(short fileRefNum,short *vRefNum); 
  26087. æDT OSErr myVariable = GetVRefNum((short) fileRefNum,(short *) vRefNum);
  26088. æRI II-89, IV-107
  26089. æC  
  26090. [Not in ROM]
  26091.  
  26092. Given a path reference number in pathRefNum, GetVRefNum returns the volume reference
  26093. number in vRefNum.
  26094.  
  26095. Result codes    noErr       No error
  26096.                 rfNumErr    Bad reference number
  26097.  
  26098. æKY PBOpenDF
  26099. æFc Files.h
  26100. æT Function
  26101. æD pascal OSErr PBOpenDF(ParmBlkPtr paramBlock,Boolean async); 
  26102. æDT OSErr myVariable = PBOpenDF((ParmBlkPtr) paramBlock,(Boolean) async);
  26103. æRI VI
  26104. æC 
  26105. OpenDF creates an access path to the data fork of a file. It is almost identical
  26106. to PBFSOpen, which is documented in the File Manager chapter of Volume IV. The
  26107. difference is that PBFSOpen can open both files and devices, but PBOpenDF can
  26108. open only files. Using OpenDF instead of FSOpen when your application is opening
  26109. a file prevents naming conflicts or ambiguities.
  26110.  
  26111. æKY PBOpenWD
  26112. æFc Files.h
  26113. æT Function
  26114. æD pascal OSErr PBOpenWD(WDPBPtr paramBlock,Boolean async); 
  26115. æDT OSErr myVariable = PBOpenWD((WDPBPtr) paramBlock,(Boolean) async);
  26116. æRT 77, 190
  26117. æRI IV-158, N77-1
  26118. æC 
  26119. Trap macro    _OpenWD
  26120.  
  26121. Parameter block
  26122.   -->    12    ioCompletion  pointer
  26123.   <--    16    ioResult      word
  26124.   -->    18    ioNamePtr     pointer
  26125.   <->    22    ioVRefNum     word
  26126.   -->    28    ioWDProcID    long word
  26127.   -->    48    ioWDDirID     long word
  26128.  
  26129. PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and ioWDProcID and
  26130. makes it a working directory. (You can also specify the directory using a combination
  26131. of partial pathname and directory ID.) It returns a working directory reference
  26132. number in ioVRefNum that can be used in subsequent calls.
  26133.  
  26134. If a given directory has already been made a working directory using the same ioWDProcID,
  26135. no new working directory will be opened; instead, the existing working directory
  26136. reference number will be returned. If a given directory was already made a working
  26137. directory using a different ioWDProcID, a new working directory reference number is
  26138. returned.
  26139.  
  26140. Result codes    noErr       No error
  26141.                 tmwdoErr    Too many working directories open
  26142.  
  26143. æKY PBCloseWD
  26144. æFc Files.h
  26145. æT Function
  26146. æD pascal OSErr PBCloseWD(WDPBPtr paramBlock,Boolean async); 
  26147. æDT OSErr myVariable = PBCloseWD((WDPBPtr) paramBlock,(Boolean) async);
  26148. æRI IV-158      
  26149. æC 
  26150. Trap macro    _CloseWD
  26151.  
  26152. Parameter block
  26153.   -->    12    ioCompletion  pointer
  26154.   <--    16    ioResult      word
  26155.   -->    22    ioVRefNum     word
  26156.  
  26157. PBCloseWD releases the working directory whose working directory reference number is
  26158. specified in ioVRefNum.
  26159.  
  26160. Note:  If a volume reference number is specified in ioVRefNum, PBCloseWD
  26161.        does nothing.
  26162.  
  26163. Result codes    noErr     No error
  26164.                 nsvErr    No such volume
  26165.  
  26166. æKY PBHSetVol
  26167. æFc Files.h
  26168. æT Function
  26169. æD pascal OSErr PBHSetVol(WDPBPtr paramBlock,Boolean async); 
  26170. æDT OSErr myVariable = PBHSetVol((WDPBPtr) paramBlock,(Boolean) async);
  26171. æRT 140
  26172. æRI IV-133, N140
  26173. æC 
  26174. •••Refer to Technical Note #140:•••
  26175.  
  26176. Trap macro    _HSetVol
  26177.  
  26178. Parameter block
  26179.   -->    12    ioCompletion  pointer
  26180.   <--    16    ioResult      word
  26181.   -->    18    ioNamePtr     pointer
  26182.   -->    22    ioVRefNum     word
  26183.   -->    48    ioWDDirID     long word
  26184.  
  26185. PBHSetVol sets both the default volume and the default directory. The default directory
  26186. to be used can be specified by either a volume reference number or a working directory
  26187. reference number in ioVRefNum, a directory ID in ioWDDirID, or a pointer to a pathname
  26188. (possibly NIL) in ioNamePtr.
  26189.  
  26190. Note:  Both the default volume and the default directory are used in
  26191.        calls made with no volume name and a volume reference number of zero.
  26192.  
  26193. Result codes    noErr     No error
  26194.                 nsvErr    No default volume
  26195.  
  26196. æKY PBHGetVol
  26197. æFc Files.h
  26198. æT Function
  26199. æD pascal OSErr PBHGetVol(WDPBPtr paramBlock,Boolean async); 
  26200. æDT OSErr myVariable = PBHGetVol((WDPBPtr) paramBlock,(Boolean) async);
  26201. æRI IV-132 
  26202. æC 
  26203. Trap macro    _HGetVol
  26204.  
  26205. Parameter block
  26206.   -->    12    ioCompletion  pointer
  26207.   <--    16    ioResult      word
  26208.   <--    18    ioNamePtr     pointer
  26209.   <--    22    ioVRefNum     word
  26210.   <--    28    ioWDProcID    long word
  26211.   <--    32    ioWDVRefNum   word
  26212.   <--    48    ioWDDirID     long word
  26213.  
  26214. PBHGetVol returns the default volume and directory last set by either a PBSetVol or a
  26215. PBHSetVol call. The reference number of the default volume is returned in ioVRefNum.
  26216.  
  26217. Warning:  IOVRefNum will return a working directory reference number
  26218.           (instead of the volume reference number) if, in the last call
  26219.           to PBSetVol or PBHSetVol, a working directory reference number
  26220.           was passed in this field.
  26221.  
  26222. The volume reference number of the volume on which the default directory exists is
  26223. returned in ioWDVRefNum. The directory ID of the default directory is returned in
  26224. ioWDDirID.
  26225.  
  26226. Result codes    noErr     No error
  26227.                 nsvErr    No default volume
  26228.  
  26229. æKY PBCatMove
  26230. æFc Files.h
  26231. æT Function
  26232. æD pascal OSErr PBCatMove(CMovePBPtr paramBlock,Boolean async); 
  26233. æDT OSErr myVariable = PBCatMove((CMovePBPtr) paramBlock,(Boolean) async);
  26234. æRI IV-157, VI
  26235. æC 
  26236. Some existing HFS functions now support file IDs as appropriate, but their
  26237. interface remains stable. This section describes how they accommodate file IDs.
  26238.  
  26239. FUNCTION PBCatMove (paramBlock: HParamBlkPtr, async: Boolean) : OSErr;
  26240.  
  26241. If a file ID exists for the file being moved, the file ID remains with the file.
  26242.  
  26243.  
  26244. •••Refer to Technical Note #226:•••
  26245.  
  26246. Trap macro    _CatMove
  26247.  
  26248. Parameter block
  26249.   -->    12    ioCompletion  pointer
  26250.   <--    16    ioResult      word
  26251.   -->    18    ioNamePtr     pointer
  26252.   -->    22    ioVRefNum     word
  26253.   -->    28    ioNewName     pointer
  26254.   -->    36    ioNewDirID    long word
  26255.   -->    48    ioDirID       long word
  26256.  
  26257. PBCatMove moves files or directories from one directory to another. The name of the
  26258. file or directory to be moved is pointed to by ioNamePtr; ioVRefNum contains either
  26259. the volume reference number or working directory reference number. A directory ID can
  26260. be specified in ioDirID. The name and directory ID of the directory to which the file
  26261. or directory is to be moved are specified by ioNewName and ioNewDirID.
  26262.  
  26263. PBCatMove is strictly a file catalog operation; it does not actually change the
  26264. location of the file or directory on the disk. PBCatMove cannot move a file or directory
  26265. to another volume (that is, ioVRefNum is used in specifying both the source and the
  26266. destination). It also cannot be used to rename files or directories; for that, use
  26267. PBHRename.
  26268.  
  26269. Result codes    noErr      No error
  26270.                 badMovErr  Attempt to move into offspring
  26271.                 bdNamErr   Bad file name or attempt to move into a file
  26272.                 dupFNErr   Duplicate file name and version
  26273.                 fnfErr     File not found
  26274.                 ioErr      I/O error
  26275.                 nsvErr     No such volume
  26276.                 paramErr   No default volume
  26277.                 vLckdErr   Software volume lock
  26278.                 wPrErr     Hardware volume lock
  26279.  
  26280. æKY PBDirCreate
  26281. æFc Files.h
  26282. æT Function
  26283. æD pascal OSErr PBDirCreate(HParmBlkPtr paramBlock,Boolean async); 
  26284. æDT OSErr myVariable = PBDirCreate((HParmBlkPtr) paramBlock,(Boolean) async);
  26285. æRI IV-146
  26286. æC 
  26287. Trap macro    _DirCreate
  26288.  
  26289. Parameter block
  26290.   -->    12    ioCompletion  pointer
  26291.   <--    16    ioResult      word
  26292.   <->    18    ioNamePtr     pointer
  26293.   -->    22    ioVRefNum     word
  26294.   <->    48    ioDirID       long word
  26295.  
  26296. PBDirCreate is identical to PBHCreate except that it creates a new directory instead
  26297. of a file. You can specify the parent of the directory to be created in ioDirID; if
  26298. it’s 0, the new directory will be placed in the root directory. The directory ID of
  26299. the new directory is returned in ioDirID.
  26300.  
  26301. Warning:  PBDirCreate operates only with the hierarchical version of
  26302.           the File Manager; if used on a Macintosh equipped only with
  26303.           the 64K ROM version of the File Manager, it will generate a
  26304.           system error.
  26305.  
  26306. Result codes    noErr      No error
  26307.                 bdNamErr   Bad file name
  26308.                 dupFNErr   Duplicate file name and version
  26309.                 dirFulErr  File directory full
  26310.                 dirNFErr   Directory not found or incomplete pathname
  26311.                 extFSErr   External file system
  26312.                 ioErr      I/O error
  26313.                 nsvErr     No such volume
  26314.                 vLckdErr   Software volume lock
  26315.                 wPrErr     Hardware volume lock
  26316.     
  26317.  
  26318. æKY PBGetWDInfo
  26319. æFc Files.h
  26320. æT Function
  26321. æD pascal OSErr PBGetWDInfo(WDPBPtr paramBlock,Boolean async); 
  26322. æDT OSErr myVariable = PBGetWDInfo((WDPBPtr) paramBlock,(Boolean) async);
  26323. æRT 77, 190
  26324. æRI IV-159, N77-5
  26325. æC 
  26326. Trap macro    _GetWDInfo
  26327.  
  26328. Parameter block
  26329.   -->    12    ioCompletion  pointer
  26330.   <--    16    ioResult      word
  26331.   <--    18    ioNamePtr     pointer
  26332.   <->    22    ioVRefNum     word
  26333.   -->    26    ioWDIndex     word
  26334.   <->    28    ioWDProcID    long word
  26335.   <->    32    ioWDVRefNum   word
  26336.   <--    48    ioWDDirID     long word
  26337.  
  26338. PBGetWDInfo returns information about the specified working directory. The working
  26339. directory can be specified either by its working directory reference number in ioVRefNum
  26340. (in which case ioWDIndex should be 0), or by its index number in ioWDIndex. In the
  26341. latter case, if ioVRefNum is nonzero, it’s interpreted as a volume specification
  26342. (volume reference number or drive number), and only working directories on that
  26343. volume are indexed.
  26344.  
  26345. IOWDVRefNum always returns the volume reference number. IOVRefNum returns a working
  26346. directory reference number when a working directory reference number is passed in
  26347. that field; otherwise, it returns a volume reference number. The volume name is
  26348. returned in ioNamePtr.
  26349.  
  26350. If IOWDProcID is nonzero, only working directories with that identifier are indexed;
  26351. otherwise all working directories are indexed.
  26352.  
  26353. Result codes    noErr     No error
  26354.                 nsvErr    No such volume
  26355.  
  26356. æKY PBGetFCBInfo
  26357. æFc Files.h
  26358. æT Function
  26359. æD pascal OSErr PBGetFCBInfo(FCBPBPtr paramBlock,Boolean async); 
  26360. æDT OSErr myVariable = PBGetFCBInfo((FCBPBPtr) paramBlock,(Boolean) async);
  26361. æRT 87
  26362. æRI IV-179, N87-1
  26363. æC  
  26364. Trap macro    _GetFCBInfo
  26365.  
  26366. Parameter block
  26367.   -->    12    ioCompletion  pointer
  26368.   <--    16    ioResult      word
  26369.   <--    18    ioNamePtr     pointer
  26370.   <->    22    ioVRefNum     word
  26371.   <->    24    ioRefNum      word
  26372.   -->    28    ioFCBIndx     long word
  26373.   <--    32    ioFCBFlNm     long word
  26374.   <--    36    ioFCBFlags    word
  26375.   <--    38    ioFCBStBlk    word
  26376.   <--    40    ioFCBEOF      long word
  26377.   <--    44    ioFCBPLen     long word
  26378.   <--    48    ioFCBCrPs     long word
  26379.   <--    52    ioFCBVRefNum  word
  26380.   <--    54    ioFCBClpSiz   long word
  26381.   <--    58    ioFCBParID    long word
  26382.  
  26383. PBGetFCBInfo returns information about the specified open file. If ioFCBIndx is
  26384. positive, the File Manager returns information about the file whose file number is
  26385. ioFCBIndx on the volume specified by ioVRefNum (which may contain a drive number,
  26386. volume reference number, or working directory reference number). If ioVRefNum is 0,
  26387. all open files are indexed; otherwise, only open files on the specified volume are
  26388. indexed.
  26389.  
  26390. If ioFCBIndx is 0, the File Manager returns information about the file whose access
  26391. path is specified by ioRefNum.
  26392.  
  26393. Assembly-language note:  The global variable FCBSPtr points to the
  26394.                          length word of the file-control-block buffer.
  26395.  
  26396. Each file control block contains 94 bytes of information about an access path; Figure
  26397. 28 shows its structure (using the assembly-language offsets).
  26398.  
  26399. •••Refer to Figure 28.•••
  26400.  
  26401. Figure 28–A File Control Block
  26402.  
  26403. 64K ROM note:  The structure of a file control block in the 64K ROM
  26404.                version of the File Manager is a subset of the above
  26405.                structure. The old file control block contained only
  26406.                the fields up to and including fcbFlPos.
  26407.  
  26408. FCBMdRByt (which corresponds to ioFCBFlags in the parameter block for PBGetFCBInfo)
  26409. contains flags that describe the status of the file, as follows:
  26410.  
  26411.   Bit    Meaning
  26412.   0     Set if data can be written to the file
  26413.   1     Set if the entry describes a resource fork
  26414.   7     Set if the file has been changed since it was last flushed
  26415.  
  26416. Warning:  The size and structure of a file control block may be
  26417.           different in future versions of Macintosh system software.
  26418.  
  26419. æKY PBGetCatInfo
  26420. æFc Files.h
  26421. æT Function
  26422. æD pascal OSErr PBGetCatInfo(CInfoPBPtr paramBlock,Boolean async); 
  26423. æDT OSErr myVariable = PBGetCatInfo((CInfoPBPtr) paramBlock,(Boolean) async);
  26424. æRT 68,69
  26425. æRI IV-155,  V-391, N68-1, N69, VI
  26426. æC
  26427. Some existing HFS functions now support file IDs as appropriate, but their
  26428. interface remains stable. This section describes how they accommodate file IDs.
  26429.  
  26430. FUNCTION PBGetCatInfo (paramBlock: HParamBlkPtr, async: Boolean) : OSErr;
  26431.  
  26432. You can use PBGetCatInfo to determine whether a file has a file ID.  The value
  26433. of the file ID is returned in ioDirID. Because that parameter could also
  26434. represent a directory ID, call PBResolveFileID to see if the value is a real
  26435. file ID.  If you want to both determine whether a file ID exists for a file and
  26436. create one if it doesn’t, use PBCreateFileID, which will either create a file ID
  26437. or return fidExists.
  26438.  
  26439. •••Refer to Technical Note #69:•••
  26440.  
  26441. Trap macro    _GetCatInfo
  26442.  
  26443. Parameter block
  26444.   Files:                                   Directories:
  26445.   -->    12    ioCompletion   pointer      -->    12    ioCompletion  pointer
  26446.   <--    16    ioResult       word         <--    16    ioResult      word
  26447.   <->    18    ioNamePtr      pointer      <->    18    ioNamePtr     pointer
  26448.   -->    22    ioVRefNum      word         -->    22    ioVRefNum     word
  26449.   <--    24    ioFRefNum      word         <--    24    ioFRefNum     word
  26450.   -->    28    ioFDirIndex    word         -->    28    ioFDirIndex   word
  26451.   <--    30    ioFlAttrib     byte         <--    30    ioFlAttrib    byte
  26452.   <--    31    ioACUser       byte         access rights for directory only
  26453.   <--    32    ioFlFndrInfo   16 bytes     <--    32    ioDrUsrWds    16 bytes
  26454.   <->    48    ioDirID        long word    <->    48    ioDrDirID     long word
  26455.   <--    52    ioFlStBlk      word         <--    52    ioDrNmFls     word
  26456.   <--    54    ioFlLgLen      long word
  26457.   <--    58    ioFlPyLen      long word
  26458.   <--    62    ioFlRStBlk     word
  26459.   <--    64    ioFlRLgLen     long word
  26460.   <--    68    ioFlRPyLen     long word
  26461.   <--    72    ioFlCrDat      long word    <--    72    ioDrCrDat    long word
  26462.   <--    76    ioFlMdDat      long word    <--    76    ioDrMdDat    long word
  26463.   <--    80    ioFlBkDat      long word    <--    80    ioDrBkDat    long word
  26464.   <--    84    ioFlXFndrInfo  16 bytes     <--    84    ioDrFndrInfo 16 bytes
  26465.   <--    100   ioFlParID      long word    <--    100    ioDrParID   long word
  26466.   <--    104   ioFlClpSiz     long word
  26467.  
  26468. PBGetCatInfo gets information about the files and directories in a file catalog. To
  26469. determine whether the information is for a file or a directory, test bit 4 of ioFlAttrib,
  26470. as described in the section “CInfoPBRec”. The information that’s returned for files
  26471. is shown in the left column, and the corresponding information for directories is
  26472. shown in the right column.
  26473.  
  26474. If ioFDirIndex is positive, the File Manager returns information about the file or
  26475. directory whose directory index is ioFDirIndex in the directory specified by ioVRefNum
  26476. (this will be the root directory if a volume reference number is provided).
  26477.  
  26478. If ioFDirIndex is 0, the File Manager returns information about the file or directory
  26479. specified by ioNamePtr, in the directory specified by ioVRefNum
  26480. (again, this will be the root directory if a volume reference number is provided).
  26481.  
  26482. If ioFDirIndex is negative, the File Manager ignores ioNamePtr and returns information
  26483. about the directory specified by ioDirID.
  26484.  
  26485. With files, PBGetCatInfo is similar to PBHGetFileInfo but returns some additional
  26486. information. If the file is open, the reference number of the first access path found
  26487. is returned in ioFRefNum, and the name of the file is returned in ioNamePtr (unless
  26488. ioNamePtr is NIL).
  26489.  
  26490. For server volume directories, in addition to the normal return parameters the ioACUser
  26491. field returns the user’s access rights in the following format:
  26492.  
  26493.   Bit    7    if set, user is not the owner of the directory.
  26494.               if clear, user is the owner of the directory.
  26495.          6–3  Reserved; this is returned set to zero.
  26496.          2    If set, user does not have Make Changes privileges
  26497.               to the directory.
  26498.               If clear, user has Make Changes privileges to the directory.
  26499.          1    If set, user does not have See Files privileges to the directory.
  26500.               If clear, user has See Files privileges to the directory.
  26501.          0    If set, user does not have See Folders privileges
  26502.               to the directory.
  26503.               If clear, user has See Folders privileges to the directory.
  26504.  
  26505. For example, if ioACUser returns zero for a given server volume directory, you know
  26506. that the user is the owner of the directory and has complete privileges to it.
  26507.  
  26508. Result codes    noErr     No error
  26509.                 bdNamErr  Bad file name
  26510.                 dirNFErr  Directory not found or incomplete pathname
  26511.                 extFSErr  External file system
  26512.                 fnfErr    File not found
  26513.                 ioErr     I/O error
  26514.                 nsvErr    No such volume
  26515.                 paramErr  No default volume
  26516.  
  26517. æKY PBSetCatInfo
  26518. æFc Files.h
  26519. æT Function
  26520. æD pascal OSErr PBSetCatInfo(CInfoPBPtr paramBlock,Boolean async); 
  26521. æDT OSErr myVariable = PBSetCatInfo((CInfoPBPtr) paramBlock,(Boolean) async);
  26522. æRI IV-156
  26523. æC 
  26524. Trap macro    _SetCatInfo
  26525.  
  26526. Parameter block
  26527.  
  26528.   Files:                                  Directories:
  26529.   -->    12    ioCompletion  pointer      -->    12    ioCompletion  pointer
  26530.   <--    16    ioResult      word         <--    16    ioResult      word
  26531.   <->    18    ioNamePtr     pointer      <->    18    ioNamePtr     pointer
  26532.   -->    22    ioVRefNum     word         -->    22    ioVRefNum     word
  26533.   -->    30    ioFlAttrib    byte         -->    30    ioFlAttrib    byte
  26534.   -->    32    ioFlFndrInfo  16 bytes     -->    32    ioDrUsrWds    16 bytes
  26535.   -->    48    ioDirID       long word    -->    48    ioDrDirID     long word
  26536.   -->    72    ioFlCrDat     long word    -->    72    ioDrCrDat     long word
  26537.   -->    76    ioFlMdDat     long word    -->    76    ioDrMdDat     long word
  26538.   -->    80    ioFlBkDat     long word    -->    80    ioDrBkDat     long word
  26539.   -->    84    ioFlXFndrInfo 16 bytes     -->    84    ioDrFndrInfo  16 bytes
  26540.   -->    104   ioFlClpSiz    long word
  26541.  
  26542. PBSetCatInfo sets information about the files and directories in a catalog. With
  26543. files, it’s similar to PBHSetFileInfo but lets you set some additional information.
  26544. The information that can be set for files is shown in the left column, and the corresponding
  26545. information for directories is shown in the right column.
  26546.  
  26547. Result codes    noErr     No error
  26548.                 bdNamErr  Bad file name
  26549.                 dirNFErr  Directory not found or incomplete pathname
  26550.                 extFSErr  External file system
  26551.                 fnfErr    File not found
  26552.                 ioErr     I/O error
  26553.                 nsvErr    No such volume
  26554.                 paramErr  No default volume
  26555.  
  26556. æKY PBAllocContig
  26557. æFc Files.h
  26558. æT Function
  26559. æD pascal OSErr PBAllocContig(ParmBlkPtr paramBlock,Boolean async); 
  26560. æDT OSErr myVariable = PBAllocContig((ParmBlkPtr) paramBlock,(Boolean) async);
  26561. æRI IV-143
  26562. æC 
  26563. Trap macro    _AllocContig
  26564.  
  26565. Parameter block
  26566.   -->    12    ioCompletion  pointer
  26567.   <--    16    ioResult      word
  26568.   -->    24    ioRefNum      word
  26569.   -->    36    ioReqCount    long word
  26570.   <--    40    ioActCount    long word
  26571.  
  26572. PBAllocContig is identical to PBAllocate except that if there isn’t enough contiguous
  26573. empty space on the volume to satisfy the allocation request, PBAllocContig will do
  26574. nothing and will return dskFulErr as its function result. If you want to allocate
  26575. whatever space is available, even when the entire request cannot be filled as a
  26576. contiguous piece, call PBAllocate instead.
  26577.  
  26578. Result codes    noErr      No error
  26579.                 dskFulErr  Disk full
  26580.                 fLckdErr   File locked
  26581.                 fnOpnErr   File not open
  26582.                 ioErr      I/O error
  26583.                 rfNumErr   Bad reference number
  26584.                 vLckdErr   Software volume lock
  26585.                 wPrErr     Hardware volume lock
  26586.                 wrPermErr  Read/write permission doesn’t allow writing
  26587.  
  26588. æKY PBLockRange
  26589. æFc Files.h
  26590. æT Function
  26591. æD pascal OSErr PBLockRange(ParmBlkPtr paramBlock,Boolean async); 
  26592. æDT OSErr myVariable = PBLockRange((ParmBlkPtr) paramBlock,(Boolean) async);
  26593. æRT 186
  26594. æRI IV-138
  26595. æC 
  26596. •••Refer to Technical Note #186:•••
  26597.  
  26598. Trap macro    _LockRng
  26599.  
  26600. Parameter block
  26601.   -->    12    ioCompletion  pointer
  26602.   <--    16    ioResult      word
  26603.   -->    24    ioRefNum      word
  26604.   -->    36    ioReqCount    long word
  26605.   -->    44    ioPosMode     word
  26606.   -->    46    ioPosOffset   long word
  26607.  
  26608. On a file opened with a shared read/write permission, PBLockRange is used in conjunction
  26609. with PBRead and PBWrite to lock a certain portion of the file. PBLockRange uses the
  26610. same parameters as both PBRead and PBWrite; by calling it immediately before PBRead,
  26611. you can use the information present in the parameter block for the PBRead call.
  26612.  
  26613. When you’re finished with the data (typically after a call to PBWrite), be sure to
  26614. call PBUnlockRange to free up that portion of the file for subsequent PBRead calls.
  26615.  
  26616. Warning:  PBLockRange operates only with the hierarchical version of the
  26617.           File Manager; if used on a Macintosh equipped only with the 64K
  26618.           ROM version of the File Manager, it will generate a system error.
  26619.  
  26620. Result codes    noErr     No error
  26621.                 eofErr    End-of-file
  26622.                 extFSErr  External file system
  26623.                 fnOpnErr  File not open
  26624.                 ioErr     I/O error
  26625.                 paramErr  Negative ioReqCount
  26626.                 rfNumErr  Bad reference number
  26627.  
  26628. æKY PBUnlockRange
  26629. æFc Files.h
  26630. æT Function
  26631. æD pascal OSErr PBUnlockRange(ParmBlkPtr paramBlock,Boolean async); 
  26632. æDT OSErr myVariable = PBUnlockRange((ParmBlkPtr) paramBlock,(Boolean) async);
  26633. æRT 186
  26634. æRI IV-139
  26635. æC 
  26636. Trap macro    _UnlockRng
  26637.  
  26638. Parameter block
  26639.   -->    12    ioCompletion  pointer
  26640.   <--    16    ioResult      word
  26641.   -->    24    ioRefNum      word
  26642.   -->    36    ioReqCount    long word
  26643.   -->    44    ioPosMode     word
  26644.   -->    46    ioPosOffset   long word
  26645.  
  26646. PBUnlockRange is used in conjunction with PBRead and PBWrite to unlock a certain
  26647. portion of a file that you locked with PBLockRange.
  26648.  
  26649. Warning:  PBUnlockRange operates only with the hierarchical version of
  26650.           the File Manager; if used on a Macintosh equipped only with
  26651.           the 64K ROM version of the File Manager, it will generate a
  26652.           system error.
  26653.  
  26654. Result codes    noErr     No error
  26655.                 eofErr    End-of-file
  26656.                 extFSErr  External file system
  26657.                 fnOpnErr  File not open
  26658.                 ioErr     I/O error
  26659.                 paramErr  Negative ioReqCount
  26660.                 rfNumErr  Bad reference number
  26661.  
  26662. æKY PBSetVInfo
  26663. æFc Files.h
  26664. æT Function
  26665. æD pascal OSErr PBSetVInfo(HParmBlkPtr paramBlock,Boolean async); 
  26666. æDT OSErr myVariable = PBSetVInfo((HParmBlkPtr) paramBlock,(Boolean) async);
  26667. æRT 204
  26668. æRI IV-131
  26669. æC 
  26670. •••Refer to Technical Note #204:•••
  26671.  
  26672. Trap macro    _SetVolInfo
  26673.  
  26674. Parameter block
  26675.   -->    12    ioCompletion  pointer
  26676.   <--    16    ioResult      word
  26677.   -->    18    ioNamePtr     pointer
  26678.   -->    22    ioVRefNum     word
  26679.   -->    30    ioVCrDate     long word
  26680.   -->    34    ioVLsMod      long word
  26681.   -->    38    ioVAtrb       word
  26682.   -->    52    ioVClpSiz     long word
  26683.   -->    72    ioVBkUp       long word
  26684.   -->    76    ioVSeqNum     word
  26685.   -->    90    ioVFndrInfo   32 bytes
  26686.  
  26687. PBSetVInfo lets you modify information about volumes. A pointer to a new name for the
  26688. volume can be specified in ioNamePtr. The date and time of the volume’s creation and
  26689. modification can be set with ioVCrDate and ioVLsMod respectively. Only bit 15 of
  26690. ioVAtrb can be changed; setting it locks the volume.
  26691.  
  26692. Note:  The volume cannot be specified by name; you must use either the
  26693.        volume reference number or the drive number.
  26694.  
  26695. Warning:  PBSetVInfo operates only with the hierarchical version of the
  26696.           File Manager; if used on a Macintosh equipped only with the
  26697.           64K ROM version of the File Manager, it will generate a system error.
  26698.  
  26699. Result codes    noErr       No error
  26700.                 nsvErr      No such volume
  26701.                 paramErr    No default volume
  26702.  
  26703. æKY PBHGetVInfo
  26704. æFc Files.h
  26705. æT Function
  26706. æD pascal OSErr PBHGetVInfo(HParmBlkPtr paramBlock,Boolean async); 
  26707. æDT OSErr myVariable = PBHGetVInfo((HParmBlkPtr) paramBlock,(Boolean) async);
  26708. æRT 24, 66, 67, 77, 106, 157
  26709. æRI IV-130, N66-1, N67-1, N77-5  
  26710. æC 
  26711. Trap macro    _HGetVInfo
  26712.  
  26713. Parameter block
  26714.   -->    12    ioCompletion  pointer
  26715.   <--    16    ioResult      word
  26716.   <->    18    ioNamePtr     pointer
  26717.   <->    22    ioVRefNum     word
  26718.   -->    28    ioVolIndex    word
  26719.   <--    30    ioVCrDate     long word
  26720.   <--    34    ioVLsMod      long word
  26721.   <--    38    ioVAtrb       word
  26722.   <--    40    ioVNmFls      word
  26723.   <--    42    ioVBitMap     word
  26724.   <--    44    ioVAllocPtr   word
  26725.   <--    46    ioVNmAlBlks   word
  26726.   <--    48    ioVAlBlkSiz   long word
  26727.   <--    52    ioVClpSiz     long word
  26728.   <--    56    ioAlBlSt      word
  26729.   <--    58    ioVNxtFNum    long word
  26730.   <--    62    ioVFrBlk      word
  26731.   <--    64    ioVSigWord    word
  26732.   <--    66    ioVDrvInfo    word
  26733.   <--    68    ioVDRefNum    word
  26734.   <--    70    ioVFSID       word
  26735.   <--    72    ioVBkUp       long word
  26736.   <--    76    ioVSeqNum     word
  26737.   <--    78    ioVWrCnt      long word
  26738.   <--    82    ioVFilCnt     long word
  26739.   <--    86    ioVDirCnt     long word
  26740.   <--    90    ioVFndrInfo   32 bytes
  26741.  
  26742. PBHGetVInfo is similar in function to PBGetVInfo but returns a larger parameter
  26743. block. In addition, PBHGetVInfo always returns the volume reference number in ioVRefNum
  26744. (regardless of what was passed in). Also, ioVNmAlBlks and ioVFrBlks are not clipped
  26745. as they are by PBGetVInfo.
  26746.  
  26747. Result codes    noErr       No error
  26748.                 nsvErr      No such volume
  26749.                 paramErr    No default volume
  26750.  
  26751. æKY PBHOpen
  26752. æFc Files.h
  26753. æT Function
  26754. æD pascal OSErr PBHOpen(HParmBlkPtr paramBlock,Boolean async); 
  26755. æDT OSErr myVariable = PBHOpen((HParmBlkPtr) paramBlock,(Boolean) async);
  26756. æRT 204
  26757. æRI IV-136 
  26758. æC 
  26759. Trap macro    _HOpen
  26760.  
  26761. Parameter block
  26762.   -->    12    ioCompletion  pointer
  26763.   <--    16    ioResult      word
  26764.   -->    18    ioNamePtr     pointer
  26765.   -->    22    ioVRefNum     word
  26766.   <--    24    ioRefNum      word
  26767.   -->    27    ioPermssn     byte
  26768.   -->    28    ioMisc        pointer
  26769.   -->    48    ioDirID       long word
  26770.  
  26771. PBHOpen is identical to PBOpen except that it accepts a directory ID in ioDirID.
  26772.  
  26773. Result codes    noErr     No error
  26774.                 bdNamErr  Bad file name
  26775.                 dirNFErr  Directory not found or incomplete pathname
  26776.                 extFSErr  External file system
  26777.                 fnfErr    File not found
  26778.                 ioErr     I/O error
  26779.                 nsvErr    No such volume
  26780.                 opWrErr   File already open for writing
  26781.                 permErr   Attempt to open locked file for writing
  26782.                 tmfoErr   Too many files open
  26783.  
  26784. æKY PBHOpenRF
  26785. æFc Files.h
  26786. æT Function
  26787. æD pascal OSErr PBHOpenRF(HParmBlkPtr paramBlock,Boolean async); 
  26788. æDT OSErr myVariable = PBHOpenRF((HParmBlkPtr) paramBlock,(Boolean) async);
  26789. æRI IV-137
  26790. æC 
  26791. Trap macro    _HOpenRF
  26792.  
  26793. Parameter block
  26794.   -->    12    ioCompletion  pointer
  26795.   <--    16    ioResult      word
  26796.   -->    18    ioNamePtr     pointer
  26797.   -->    22    ioVRefNum     word
  26798.   <--    24    ioRefNum      word
  26799.   -->    27    ioPermssn     byte
  26800.   -->    28    ioMisc        pointer
  26801.   -->    48    ioDirID       long word
  26802.  
  26803. PBHOpenRF is identical to PBOpenRF except that it accepts a directory ID in ioDirID.
  26804.  
  26805. Result codes    noErr     No error
  26806.                 bdNamErr  Bad file name
  26807.                 dirNFErr  Directory not found or incomplete pathname
  26808.                 extFSErr  External file system
  26809.                 fnfErr    File not found
  26810.                 ioErr     I/O error
  26811.                 nsvErr    No such volume
  26812.                 opWrErr   File already open for writing
  26813.                 permErr   Attempt to open locked file for writing
  26814.                 tmfoErr   Too many files open
  26815.  
  26816. æKY PBHOpenDF
  26817. æFc Files.h
  26818. æT Function
  26819. æD pascal OSErr PBHOpenDF(HParmBlkPtr paramBlock,Boolean async); 
  26820. æDT OSErr myVariable = PBHOpenDF((HParmBlkPtr) paramBlock,(Boolean) async);
  26821. æRI VI
  26822. æC 
  26823. PBHOpenDF creates an access path to the data fork of a file. It is an HFS
  26824. version of PBOpenDF.
  26825.  
  26826. æKY PBHCreate
  26827. æFc Files.h
  26828. æT Function
  26829. æD pascal OSErr PBHCreate(HParmBlkPtr paramBlock,Boolean async); 
  26830. æDT OSErr myVariable = PBHCreate((HParmBlkPtr) paramBlock,(Boolean) async);
  26831. æRI IV-146 
  26832. æC 
  26833. Trap macro    _HCreate
  26834.  
  26835. Parameter block
  26836.   -->    12    ioCompletion  pointer
  26837.   <--    16    ioResult      word
  26838.   -->    18    ioNamePtr     pointer
  26839.   -->    22    ioVRefNum     word
  26840.   -->    48    ioDirID       long word
  26841.  
  26842. PBHCreate is identical to PBCreate except that it accepts a directory ID in ioDirID.
  26843.  
  26844. Note:  To create a directory instead of a file, call PBDirCreate.
  26845.  
  26846. Result codes    noErr      No error
  26847.                 bdNamErr   Bad file name
  26848.                 dupFNErr   Duplicate file name and version
  26849.                 dirFulErr  File directory full
  26850.                 dirNFErr   Directory not found or incomplete pathname
  26851.                 extFSErr   External file system
  26852.                 ioErr      I/O error
  26853.                 nsvErr     No such volume
  26854.                 vLckdErr   Software volume lock
  26855.                 wPrErr     Hardware volume lock
  26856.  
  26857. æKY PBHDelete
  26858. æFc Files.h
  26859. æT Function
  26860. æD pascal OSErr PBHDelete(HParmBlkPtr paramBlock,Boolean async); 
  26861. æDT OSErr myVariable = PBHDelete((HParmBlkPtr) paramBlock,(Boolean) async);
  26862. æRI IV-147, VI
  26863. æC 
  26864. Some existing HFS functions now support file IDs as appropriate, but their
  26865. interface remains stable. This section describes how they accommodate file IDs.
  26866.  
  26867. FUNCTION PBHDelete (paramBlock: HParamBlkPtr, async: Boolean) : OSErr;
  26868.  
  26869. If a file ID exists for the file being deleted, the file ID is also deleted.
  26870.  
  26871.  
  26872. Trap macro    _HDelete
  26873.  
  26874. Parameter block
  26875.   -->    12    ioCompletion  pointer
  26876.   <--    16    ioResult      word
  26877.   -->    18    ioNamePtr     pointer
  26878.   -->    22    ioVRefNum     word
  26879.   -->    48    ioDirID       long word
  26880.  
  26881. PBHDelete is identical to PBDelete except that it accepts a directory ID in ioDirID.
  26882. PBHDelete can be used to delete an empty directory as well.
  26883.  
  26884. Result codes    noErr     No error
  26885.                 bdNamErr  Bad file name
  26886.                 dirNFErr  Directory not found or incomplete pathname
  26887.                 extFSErr  External file system
  26888.                 fBsyErr   File busy, directory not empty, or working
  26889.                           directory control block open
  26890.                 fLckdErr  File locked
  26891.                 fnfErr    File not found
  26892.                 nsvErr    No such volume
  26893.                 ioErr     I/O error
  26894.                 vLckdErr  Software volume lock
  26895.                 wPrErr    Hardware volume lock
  26896.  
  26897. æKY PBHRename
  26898. æFc Files.h
  26899. æT Function
  26900. æD pascal OSErr PBHRename(HParmBlkPtr paramBlock,Boolean async); 
  26901. æDT OSErr myVariable = PBHRename((HParmBlkPtr) paramBlock,(Boolean) async);
  26902. æRI IV-154, VI 
  26903. æC 
  26904.  
  26905.  
  26906. Some existing HFS functions now support file IDs as appropriate, but their
  26907. interface remains stable. This section describes how they accommodate file IDs.
  26908.  
  26909.  
  26910. FUNCTION PBHRename (paramBlock: HParamBlkPtr, async: Boolean) : OSErr;
  26911.  
  26912. If a file ID exists for the file being renamed, the file ID remains with the
  26913. file.
  26914.  
  26915. Trap macro    _HRename
  26916.  
  26917. Parameter block
  26918.   -->    12    ioCompletion  pointer
  26919.   <--    16    ioResult      word
  26920.   -->    18    ioNamePtr     pointer
  26921.   -->    22    ioVRefNum     word
  26922.   -->    28    ioMisc        pointer
  26923.   -->    48    ioDirID       long word
  26924.  
  26925. PBHRename is identical to PBRename except that it accepts a directory ID in ioDirID
  26926. and can be used to rename directories as well as files and volumes. Given a pointer
  26927. to the name of a file or directory in ioNamePtr, PBHRename changes it to the name
  26928. pointed to by ioMisc. Given a pointer to a volume name in ioNamePtr or a volume
  26929. reference number in ioVRefNum, it changes the name of the volume to the name pointed
  26930. to by ioMisc.
  26931.  
  26932. Warning:  PBHRename cannot be used to change the directory a file is in.
  26933.  
  26934. Result codes    noErr      No error
  26935.                 bdNamErr   Bad file name
  26936.                 dirFulErr  File directory full
  26937.                 dirNFErr   Directory not found or incomplete pathname
  26938.                 dupFNErr   Duplicate file name and version
  26939.                 extFSErr   External file system
  26940.                 fLckdErr   File locked
  26941.                 fnfErr     File not found
  26942.                 fsRnErr    Problem during rename
  26943.                 ioErr      I/O error
  26944.                 nsvErr     No such volume
  26945.                 paramErr   No default volume
  26946.                 vLckdErr   Software volume lock
  26947.                 wPrErr     Hardware volume lock
  26948.  
  26949. æKY PBHRstFLock
  26950. æFc Files.h
  26951. æT Function
  26952. æD pascal OSErr PBHRstFLock(HParmBlkPtr paramBlock,Boolean async); 
  26953. æDT OSErr myVariable = PBHRstFLock((HParmBlkPtr) paramBlock,(Boolean) async);
  26954. æRI IV-152 
  26955. æC 
  26956. Trap macro    _HRstFLock
  26957.  
  26958. Parameter block
  26959.   -->    12    ioCompletion  pointer
  26960.   <--    16    ioResult      word
  26961.   -->    18    ioNamePtr     pointer
  26962.   -->    22    ioVRefNum     word
  26963.   -->    48    ioDirID       long word
  26964.  
  26965. PBHRstFLock is identical to PBRstFLock except that it accepts a directory ID in
  26966. ioDirID.
  26967.  
  26968. Result codes    noErr     No error
  26969.                 dirNFErr  Directory not found or incomplete pathname
  26970.                 extFSErr  External file system
  26971.                 fnfErr    File not found
  26972.                 ioErr     I/O error
  26973.                 nsvErr    No such volume
  26974.                 vLckdErr  Software volume lock
  26975.                 wPrErr    Hardware volume lock
  26976.  
  26977. æKY PBHSetFLock
  26978. æFc Files.h
  26979. æT Function
  26980. æD pascal OSErr PBHSetFLock(HParmBlkPtr paramBlock,Boolean async); 
  26981. æDT OSErr myVariable = PBHSetFLock((HParmBlkPtr) paramBlock,(Boolean) async);
  26982. æRI IV-151
  26983. æC 
  26984. Trap macro    _HSetFLock
  26985.  
  26986. Parameter block
  26987.   -->    12    ioCompletion  pointer
  26988.   <--    16    ioResult      word
  26989.   -->    18    ioNamePtr     pointer
  26990.   -->    22    ioVRefNum     word
  26991.   -->    48    ioDirID       long word
  26992.  
  26993. PBHSetFLock is identical to PBSetFLock except that it accepts a directory ID in
  26994. ioDirID.
  26995.  
  26996. Result codes    noErr     No error
  26997.                 dirNFErr  Directory not found or incomplete pathname
  26998.                 extFSErr  External file system
  26999.                 fnfErr    File not found
  27000.                 ioErr     I/O error
  27001.                 nsvErr    No such volume
  27002.                 vLckdErr  Software volume lock
  27003.                 wPrErr    Hardware volume lock
  27004.  
  27005. æKY PBHGetFInfo
  27006. æFc Files.h
  27007. æT Function
  27008. æD pascal OSErr PBHGetFInfo(HParmBlkPtr paramBlock,Boolean async); 
  27009. æDT OSErr myVariable = PBHGetFInfo((HParmBlkPtr) paramBlock,(Boolean) async);
  27010. æRI IV-149 
  27011. æC 
  27012. Trap macro    _HGetFileInfo
  27013.  
  27014. Parameter block
  27015.   -->    12    ioCompletion  pointer
  27016.   <--    16    ioResult      word
  27017.   <->    18    ioNamePtr     pointer
  27018.   -->    22    ioVRefNum     word
  27019.   <--    24    ioFRefNum     word
  27020.   -->    28    ioFDirIndex   word
  27021.   <--    30    ioFlAttrib    byte
  27022.   <--    32    ioFlFndrInfo  16 bytes
  27023.   <->    48    ioDirID       long word
  27024.   <--    52    ioFlStBlk     word
  27025.   <--    54    ioFlLgLen     long word
  27026.   <--    58    ioFlPyLen     long word
  27027.   <--    62    ioFlRStBlk    word
  27028.   <--    64    ioFlRLgLen    long word
  27029.   <--    68    ioFlRPyLen    long word
  27030.   <--    72    ioFlCrDat     long word
  27031.   <--    76    ioFlMdDat     long word
  27032.  
  27033. PBHGetFInfo is identical to PBGetFInfo except that it accepts a directory ID in
  27034. ioDirID.
  27035.  
  27036. Result codes    noErr     No error
  27037.                 bdNamErr  Bad file name
  27038.                 dirNFErr  Directory not found or incomplete pathname
  27039.                 extFSErr  External file system
  27040.                 fnfErr    File not found
  27041.                 ioErr     I/O error
  27042.                 nsvErr    No such volume
  27043.                 paramErr  No default volume
  27044.  
  27045. æKY PBHSetFInfo
  27046. æFc Files.h
  27047. æT Function
  27048. æD pascal OSErr PBHSetFInfo(HParmBlkPtr paramBlock,Boolean async); 
  27049. æDT OSErr myVariable = PBHSetFInfo((HParmBlkPtr) paramBlock,(Boolean) async);
  27050. æRI IV-150
  27051. æC 
  27052. Trap macro    _HSetFileInfo
  27053.  
  27054. Parameter block
  27055.   -->    12    ioCompletion  pointer
  27056.   <--    16    ioResult      word
  27057.   -->    18    ioNamePtr     pointer
  27058.   -->    22    ioVRefNum     word
  27059.   -->    32    ioFlFndrInfo  16 bytes
  27060.   -->    48    ioDirID       long word
  27061.   -->    72    ioFlCrDat     long word
  27062.   -->    76    ioFlMdDat     long word
  27063.  
  27064. PBHSetFInfo is identical to PBSetFInfo except that it accepts a directory ID in
  27065. ioDirID.
  27066.  
  27067. Result codes    noErr     No error
  27068.                 bdNamErr  Bad file name
  27069.                 dirNFErr  Directory not found or incomplete pathname
  27070.                 extFSErr  External file system
  27071.                 fLckdErr  File locked
  27072.                 fnfErr    File not found
  27073.                 ioErr     I/O error
  27074.                 nsvErr    No such volume
  27075.                 vLckdErr  Software volume lock
  27076.                 wPrErr    Hardware volume lock
  27077.  
  27078. æKY PBGetAltAccess
  27079. æFc Files.h
  27080. æT Function
  27081. æD pascal OSErr PBGetAltAccess(HParmBlkPtr paramBlock,Boolean async); 
  27082. æDT OSErr myVariable = PBGetAltAccess((HParmBlkPtr) paramBlock,(Boolean) async);
  27083. æRI VI
  27084. æC 
  27085. Parameter block
  27086.   Æ   12  ioCompletion   long  pointer to completion routine
  27087.   ¨   16  ioResult       word  result code
  27088.   Æ   18  ioNamePtr      long  pointer to volume name
  27089.   ¨   22  ioVRefNum      word  volume reference number
  27090.   ¨   32  ioBuffer       long  pointer to privilege info buffer
  27091.   Æ   36  ioReqCount     long  size allocated for buffer
  27092.   ¨   40  ioActCount     long  amount used in buffer
  27093.   ¨   44  ioAccessInfo1  long  information specific to privilege model
  27094.   ¨   48  ioAccessInfo2  long  information specific to privilege model
  27095.   ¨   52  ioAccessInfo3  long  information specific to privilege model
  27096.   ¨   56  ioAccessInfo4  long  information specific to privilege model
  27097.   Æ   60  ioDirID        word  parent directory ID
  27098.  
  27099. PBGetAltAccess retrieves access information from a volume managed by a file
  27100. system that uses a privilege model different from the AFP model.
  27101.  
  27102. Result codes
  27103. <to come>
  27104.  
  27105. æKY PBSetAltAccess
  27106. æFc Files.h
  27107. æT Function
  27108. æD pascal OSErr PBSetAltAccess(HParmBlkPtr paramBlock,Boolean async); 
  27109. æDT OSErr myVariable = PBSetAltAccess((HParmBlkPtr) paramBlock,(Boolean) async);
  27110. æRI VI
  27111. æC 
  27112. Parameter block
  27113.   Æ   12  ioCompletion   long  pointer to completion routine
  27114.   ¨   16  ioResult       word  result code
  27115.   Æ   18  ioNamePtr      long  pointer to volume name
  27116.   Æ   22  ioVRefNum      word  volume reference number
  27117.   ¨   32  ioBuffer       long  pointer to privilege info buffer
  27118.   Æ   36  ioReqCount     long  size allocated for buffer
  27119.   ¨   40  ioActCount     long  amount used in buffer
  27120.   Æ   44  ioAccessInfo1  long  information specific to privilege model
  27121.   Æ   48  ioAccessInfo2  long  information specific to privilege model
  27122.   Æ   52  ioAccessInfo3  long  information specific to privilege model
  27123.   Æ   56  ioAccessInfo4  long  information specific to privilege model
  27124.   Æ   60  ioDirID        word  parent directory ID
  27125.  
  27126. PBSetAltAccess modifies access information from a volume managed by a file
  27127. system that uses a privilege model different from the AFP model.
  27128.  
  27129. Result codes
  27130. <to come>
  27131.  
  27132. æKY PBMakeFSSpec
  27133. æFc Files.h
  27134. æT Function
  27135. æD 
  27136. pascal OSErr PBMakeFSSpec(HParamBlkPtr paramBlock,Boolean async); 
  27137. æDT OSErr myVariable = PBMakeFSSpec((HParamBlkPtr) paramBlock,(Boolean) async);
  27138. æC 
  27139.  
  27140. æKY FInitQueue
  27141. æFc Files.h
  27142. æT Function
  27143. æTN A016
  27144. æD pascal void FInitQueue(void)
  27145.     = 0xA016; 
  27146. æDT FInitQueue()(void);
  27147. æRI II-103, IV-128
  27148. æC 
  27149. Trap macro    _InitQueue
  27150.  
  27151. FInitQueue clears all queued File Manager calls except the current one.
  27152.  
  27153. æKY GetFSQHdr
  27154. æFc Files.h
  27155. æT Function
  27156. æD pascal QHdrPtr GetFSQHdr(void); 
  27157. æDT QHdrPtr myVariable = GetFSQHdr()(void);
  27158. æRI II-125, IV-175
  27159. æC 
  27160. You can get a pointer to the header of the file I/O queue by calling the File Manager
  27161. function GetFSQHdr.
  27162.  
  27163. FUNCTION GetFSQHdr :  QHdrPtr; [Not in ROM]
  27164.  
  27165. GetFSQHdr returns a pointer to the header of the file I/O queue.
  27166.  
  27167. Assembly-language note:  The global variable FSQHdr contains the
  27168.                          header of the file I/O queue.
  27169.  
  27170. æKY GetDrvQHdr
  27171. æFc Files.h
  27172. æT Function
  27173. æD pascal QHdrPtr GetDrvQHdr(void); 
  27174. æDT QHdrPtr myVariable = GetDrvQHdr()(void);
  27175. æRI II-128, IV-181
  27176. æC 
  27177. You can get a pointer to the header of the drive queue by calling the File Manager
  27178. function GetDrvQHdr.
  27179.  
  27180. FUNCTION GetDrvQHdr :  QHdrPtr; [Not in ROM]
  27181.  
  27182. GetDrvQHdr returns a pointer to the header of the drive queue.
  27183.  
  27184. Assembly-language note:  The global variable DrvQHdr contains the
  27185.                          header of the drive queue.
  27186.  
  27187. The drive queue can support any number of drives, limited only by memory space.
  27188.  
  27189. æKY GetVCBQHdr
  27190. æFc Files.h
  27191. æT Function
  27192. æD pascal QHdrPtr GetVCBQHdr(void); 
  27193. æDT QHdrPtr myVariable = GetVCBQHdr()(void);
  27194. æRI II-126, IV-178
  27195. æC 
  27196. You can get a pointer to the header of the volume-control-block queue by calling the
  27197. File Manager function GetVCBQHdr.
  27198.  
  27199. FUNCTION GetVCBQHdr :  QHdrPtr; [Not in ROM]
  27200.  
  27201. GetVCBQHdr returns a pointer to the header of the volume-control-block queue.
  27202.  
  27203. Assembly-language note:  The global variable VCBQHdr contains the header
  27204.                          of the volume-control-block-queue. The default
  27205.                          volume’s volume control block is pointed to by
  27206.                          the global variable DefVCBPtr.
  27207.  
  27208. æKY HGetVol
  27209. æFc Files.h
  27210. æT Function
  27211. æD pascal OSErr HGetVol(StringPtr volName,short *vRefNum,long *dirID); 
  27212. æDT OSErr myVariable = HGetVol((StringPtr) volName,(short *) vRefNum,(long *) dirID);
  27213. æRI IV-132, VI
  27214. æC 
  27215. HGetVol  is an HFS version of the MFS function GetVol. It calls the function
  27216. PBHGetVol, documented in the File Manager chapter of Volume IV. vRefNum can hold
  27217. a volume reference number or a working directory reference number. dirID holds a
  27218. directory ID.
  27219.  
  27220. Trap macro  _HGetVol
  27221.  
  27222. Parameter block
  27223.   —>  12  ioCompletion  pointer
  27224.   <—  16  ioResult        word
  27225.   <—  18  ioNamePtr       pointer
  27226.   <—  22  ioVRefNum       word
  27227.   <—  28  ioWDProcID       long word
  27228.   <—  32  ioWDVRefNum  word
  27229.   <—  48  ioWDDirID  long word  
  27230.  
  27231. PBHGetVol returns the default volume and directory last set by either a 
  27232. PBSetVol or a PBHSetVol call.  The reference number of the default volume 
  27233. is returned in ioVRefNum.
  27234.  
  27235. Warning:
  27236.  
  27237.     IOVRefNum will return a working directory reference 
  27238.     number (instead of the volume reference number) if, in the last call to 
  27239.     PBSetVol or PBHSetVol, a working directory reference number was 
  27240.     passed in this field.  
  27241.  
  27242. The volume reference number of the volume on which the default directory 
  27243. exists is returned in ioWDVRefNum.  The directory ID of the default 
  27244. directory is returned in ioWDDirID.
  27245.  
  27246. Result codes
  27247.  
  27248.     noErr  No error
  27249.     nsvErr  No default volume
  27250.  
  27251. æKY HSetVol
  27252. æFc Files.h
  27253. æT Function
  27254. æD pascal OSErr HSetVol(StringPtr volName,short vRefNum,long dirID); 
  27255. æDT OSErr myVariable = HSetVol((StringPtr) volName,(short) vRefNum,(long) dirID);
  27256. æRI IV-133, VI
  27257. æC 
  27258. HSetVol is an HFS version of the MFS function GetVol. It calls the function
  27259. PBHGetVol, documented in the File Manager chapter of Volume IV. vRefNum can hold
  27260. a volume reference number or a working directory reference number. dirID holds a
  27261. directory ID.
  27262.  
  27263. <Note: Don’t use HSetVol or PBHSetVol.>
  27264.  
  27265.  
  27266. æKY HOpen
  27267. æFc Files.h
  27268. æT Function
  27269. æD pascal OSErr HOpen(short vRefNum,long dirID,const Str255 fileName,char permission,
  27270.     short *refNum); 
  27271. æDT OSErr myVariable = HOpen((short) vRefNum,(long) dirID,(const Str255) fileName,(char) permission,(
  27272.     short) * refNum);
  27273. æRI IV-136, VI
  27274. æC 
  27275. HOpen creates an access path to the data fork of a file. It is an HFS version of
  27276. the MFS function Open. It calls the function PBHOpen, documented in the File
  27277. Manager chapter of Volume IV.
  27278.  
  27279. Trap macro  _HOpen
  27280.  
  27281. Parameter block
  27282.   —>  12  ioCompletion  pointer
  27283.   <—  16  ioResult  word
  27284.   —>  18  ioNamePtr  pointer
  27285.   —>  22  ioVRefNum  word
  27286.   <—  24  ioRefNum  word
  27287.   —>  27  ioPermssn  byte
  27288.   —>  28  ioMisc  pointer
  27289.   —>  48  ioDirID  long word
  27290.  
  27291. PBHOpen is identical to PBOpen except that it accepts a directory ID in 
  27292. ioDirID.
  27293.  
  27294. Result codes
  27295.   
  27296.   noErr     No error
  27297.   bdNamErr  Bad file name
  27298.   dirNFErr  Directory not found or incomplete pathname
  27299.   extFSErr  External file system
  27300.   fnfErr    File not found
  27301.   ioErr     I/O error
  27302.   nsvErr    No such volume
  27303.   opWrErr   File already open for writing
  27304.   permErr   Attempt to open locked file for writing
  27305.   tmfoErr   Too many files open
  27306.  
  27307. æKY HOpenRF
  27308. æFc Files.h
  27309. æT Function
  27310. æD pascal OSErr HOpenRF(short vRefNum,long dirID,const Str255 fileName,char permission,
  27311.     short *refNum); 
  27312. æDT OSErr myVariable = HOpenRF((short) vRefNum,(long) dirID,(const Str255) fileName,(char) permission,(
  27313.     short) * refNum);
  27314. æRI IV-137, VI
  27315. æC 
  27316. HOpenRF creates an access path to the resource fork of a file. It is an HFS
  27317. version of the MFS function OpenRF. It calls the function PBHOpenRF, documented
  27318. in the File Manager chapter of Volume IV.
  27319.  
  27320. Trap macro  _HOpenRF
  27321.  
  27322. Parameter block
  27323.     —>  12  ioCompletion    pointer
  27324.     <—  16  ioResult        word
  27325.     —>  18  ioNamePtr       pointer
  27326.     —>  22  ioVRefNum       word
  27327.     <—  24  ioRefNum        word
  27328.     —>  27  ioPermssn       byte
  27329.     —>  28  ioMisc          pointer
  27330.     —>  48  ioDirID         long word
  27331.  
  27332.     PBHOpenRF is identical to PBOpenRF except that it accepts a
  27333. directory ID in ioDirID.
  27334.  
  27335. Result codes
  27336.  
  27337.     noErr       No error
  27338.     bdNamErr    Bad file name
  27339.     dirNFErr    Directory not found or incomplete pathname
  27340.     extFSErr    External file system
  27341.     fnfErr      File not found
  27342.     ioErr       I/O error
  27343.     nsvErr      No such volume
  27344.     opWrErr     File already open for writing
  27345.     permErr     Attempt to open locked file for writing
  27346.     tmfoErr     Too many files open
  27347.  
  27348. æKY AllocContig
  27349. æFc Files.h
  27350. æT Function
  27351. æD pascal OSErr AllocContig(short refNum,long *count); 
  27352. æDT OSErr myVariable = AllocContig((short) refNum,(long *) count);
  27353. æRT 218
  27354. æRI IV-143, VI
  27355. æC 
  27356. AllocContig is a high-level function that calls PBAllocContig.
  27357.  
  27358. Trap macro  _AllocContig
  27359.  
  27360. Parameter block
  27361.     —>  12  ioCompletion    pointer
  27362.     <—  16  ioResult        word
  27363.     —>  24  ioRefNum        word
  27364.     —>  36  ioReqCount      long word
  27365.     <—  40  ioActCount      long word
  27366.  
  27367.     PBAllocContig is identical to PBAllocate except that if there isn’t
  27368. enough contiguous empty space on the volume to satisfy the allocation
  27369. request, PBAllocContig will do nothing and will return dskFulErr as its
  27370. function result. If you want to allocate whatever space is available,
  27371. even when the entire request cannot be filled as a contiguous piece,
  27372. call PBAllocate instead.
  27373.  
  27374. Result codes
  27375.  
  27376.     noErr       No error
  27377.     dskFulErr   Disk full
  27378.     fLckdErr    File locked
  27379.     fnOpnErr    File not open
  27380.     ioErr       I/O error
  27381.     rfNumErr    Bad reference number
  27382.     vLckdErr    Software volume lock
  27383.     wPrErr      Hardware volume lock
  27384.     wrPermErr   Read/write permission doesn’t allow writing
  27385.  
  27386. æKY HCreate
  27387. æFc Files.h
  27388. æT Function
  27389. æD pascal OSErr HCreate(short vRefNum,long dirID,const Str255 fileName,OSType creator,
  27390.     OSType fileType); 
  27391. æDT OSErr myVariable = HCreate((short) vRefNum,(long) dirID,(const Str255) fileName,(OSType) creator,()
  27392.     OSType fileType);
  27393. æRT 218
  27394. æRI IV-146, VI
  27395. æC 
  27396. HCreate creates a new file and sets the type and creator. It is an HFS version
  27397. of the MFS function Create.  vRefNum can hold a volume reference number or a
  27398. working directory reference number. dirID holds a directory ID.
  27399.  
  27400. HCreate calls the function PBHCreate, documented in the File Manager chapter of
  27401. Volume IV.
  27402.  
  27403. Trap macro  _HCreate
  27404.  
  27405. Parameter block
  27406.     —>  12  ioCompletion    pointer
  27407.     <—  16  ioResult        word
  27408.     —>  18  ioNamePtr       pointer
  27409.     —>  22  ioVRefNum       word
  27410.     —>  48  ioDirID         long word
  27411.  
  27412.     PBHCreate is identical to PBCreate except that it accepts a
  27413. directory ID in ioDirID.
  27414.  
  27415. Note:  
  27416.  
  27417.     To create a directory instead of a file, call PBDirCreate.
  27418.  
  27419. Result codes
  27420.  
  27421.     noErr       No error
  27422.     bdNamErr    Bad file name
  27423.     dupFNErr    Duplicate file name and version
  27424.     dirFulErr   File directory full
  27425.     dirNFErr    Directory not found or incomplete pathname
  27426.     extFSErr    External file system
  27427.     ioErr       I/O error
  27428.     nsvErr      No such volume
  27429.     vLckdErr    Software volume lock
  27430.     wPrErr      Hardware volume lock
  27431.  
  27432. æKY DirCreate
  27433. æFc Files.h
  27434. æT Function
  27435. æD pascal OSErr DirCreate(short vRefNum,long parentDirID,const Str255 directoryName,
  27436.     long *createdDirID); 
  27437. æDT OSErr myVariable = DirCreate((short) vRefNum,(long) parentDirID,(const Str255) directoryName,(
  27438.     long) * createdDirID);
  27439. æRT 218
  27440. æRI IV-146, VI
  27441. æC 
  27442. DirCreate is a high-level function that calls PBDirCreate.
  27443.  
  27444. Trap macro  _DirCreate
  27445.  
  27446. Parameter block
  27447.     —>  12  ioCompletion    pointer
  27448.     <—  16  ioResult        word
  27449.     <–> 18  ioNamePtr       pointer
  27450.     —>  22  ioVRefNum       word
  27451.     <–> 48  ioDirID         long word
  27452.  
  27453.     PBDirCreate is identical to PBHCreate except that it creates a new
  27454. directory instead of a file. You can specify the parent of the
  27455. directory to be created in ioDirID; if it’s 0, the new directory will be
  27456. placed in the root directory. The directory ID of the new directory is
  27457. returned in ioDirID.
  27458.  
  27459. Warning:
  27460.  
  27461.     PBDirCreate operates only with the hierarchical version of the
  27462.     File Manager; if used on a Macintosh equipped only with the
  27463.     64K ROM version of the File Manager, it will generate a system
  27464.     error.
  27465.  
  27466. Result codes
  27467.  
  27468.     noErr       No error
  27469.     bdNamErr    Bad file name
  27470.     dupFNErr    Duplicate file name and version
  27471.     dirFulErr   File directory full
  27472.     dirNFErr    Directory not found or incomplete pathname
  27473.     extFSErr    External file system
  27474.     ioErr       I/O error
  27475.     nsvErr      No such volume
  27476.     vLckdErr    Software volume lock
  27477.     wPrErr      Hardware volume lock
  27478.  
  27479. æKY HDelete
  27480. æFc Files.h
  27481. æT Function
  27482. æD pascal OSErr HDelete(short vRefNum,long dirID,const Str255 fileName); 
  27483. æDT OSErr myVariable = HDelete((short) vRefNum,(long) dirID,(const Str255) fileName);
  27484. æRI IV-147, VI
  27485. æC 
  27486. HDelete removes a closed file. It is an HFS version of the MFS function Delete.
  27487. vRefNum can hold a volume reference number or a working directory reference
  27488. number. dirID holds a directory ID.
  27489.  
  27490. HDelete calls the function PBHDelete, documented in the File Manager chapter of
  27491. Volume IV.
  27492.  
  27493.  
  27494. Trap macro  _HDelete
  27495.  
  27496. Parameter block
  27497.     —>  12  ioCompletion    pointer
  27498.     <—  16  ioResult        word
  27499.     —>  18  ioNamePtr       pointer
  27500.     —>  22  ioVRefNum       word
  27501.     —>  48  ioDirID         long word
  27502.  
  27503.     PBHDelete is identical to PBDelete except that it accepts a
  27504. directory ID in ioDirID. PBHDelete can be used to delete an empty
  27505. directory as well.
  27506.  
  27507. Result codes
  27508.  
  27509.     noErr       No error
  27510.     bdNamErr    Bad file name
  27511.     dirNFErr    Directory not found or incomplete pathname
  27512.     extFSErr    External file system
  27513.     fBsyErr     File busy, directory not empty, or working directory control block open
  27514.     fLckdErr    File locked
  27515.     fnfErr      File not found
  27516.     nsvErr      No such volume
  27517.     ioErr       I/O error
  27518.     vLckdErr    Software volume lock
  27519.     wPrErr      Hardware volume lock
  27520.  
  27521. æKY HGetFInfo
  27522. æFc Files.h
  27523. æT Function
  27524. æD pascal OSErr HGetFInfo(short vRefNum,long dirID,const Str255 fileName,FInfo *fndrInfo); 
  27525. æDT OSErr myVariable = HGetFInfo((short) vRefNum,(long) dirID,(const Str255) fileName,(FInfo *) fndrInfo);
  27526. æRI IV-149
  27527. æC Trap macro  _HGetFileInfo
  27528.  
  27529. Parameter block
  27530.     —>  12  ioCompletion    pointer
  27531.     <—  16  ioResult        word
  27532.     <–> 18  ioNamePtr       pointer
  27533.     —>  22  ioVRefNum       word
  27534.     <—  24  ioFRefNum       word
  27535.     —>  28  ioFDirIndex     word
  27536.     <—  30  ioFlAttrib      byte
  27537.     <—  32  ioFlFndrInfo    16 bytes
  27538.     <–> 48  ioDirID         long word
  27539.     <—  52  ioFlStBlk       word
  27540.     <—  54  ioFlLgLen       long word
  27541.     <—  58  ioFlPyLen       long word
  27542.     <—  62  ioFlRStBlk      word
  27543.     <—  64  ioFlRLgLen      long word
  27544.     <—  68  ioFlRPyLen      long word
  27545.     <—  72  ioFlCrDat       long word
  27546.     <—  76  ioFlMdDat       long word
  27547.  
  27548.     PBHGetFInfo is identical to PBGetFInfo except that it accepts a
  27549. directory ID in ioDirID.
  27550.  
  27551. Result codes
  27552.  
  27553.     noErr       No error
  27554.     bdNamErr    Bad file name
  27555.     dirNFErr    Directory not found or incomplete pathname
  27556.     extFSErr    External file system
  27557.     fnfErr      File not found
  27558.     ioErr       I/O error
  27559.     nsvErr      No such volume
  27560.     paramErr    No default volume
  27561.  
  27562. æKY HSetFInfo
  27563. æFc Files.h
  27564. æT Function
  27565. æD pascal OSErr HSetFInfo(short vRefNum,long dirID,const Str255 fileName,const FInfo *fndrInfo); 
  27566. æDT OSErr myVariable = HSetFInfo((short) vRefNum,(long) dirID,(const Str255) fileName,(const FInfo *) fndrInfo);
  27567. æRI IV-150
  27568. æC Trap macro  _HSetFileInfo
  27569.  
  27570. Parameter block
  27571.     —>  12  ioCompletion    pointer
  27572.     <—  16  ioResult        word
  27573.     —>  18  ioNamePtr       pointer
  27574.     —>  22  ioVRefNum       word
  27575.     —>  32  ioFlFndrInfo    16 bytes
  27576.     —>  48  ioDirID         long word
  27577.     —>  72  ioFlCrDat       long word
  27578.     —>  76  ioFlMdDat       long word
  27579.  
  27580.     PBHSetFInfo is identical to PBSetFInfo except that it accepts a
  27581. directory ID in ioDirID.
  27582.  
  27583. Result codes
  27584.  
  27585.     noErr       No error
  27586.     bdNamErr    Bad file name
  27587.     dirNFErr    Directory not found or incomplete pathname
  27588.     extFSErr    External file system
  27589.     fLckdErr    File locked
  27590.     fnfErr      File not found
  27591.     ioErr       I/O error
  27592.     nsvErr      No such volume
  27593.     vLckdErr    Software volume lock
  27594.     wPrErr      Hardware volume lock
  27595.  
  27596. æKY HSetFLock
  27597. æFc Files.h
  27598. æT Function
  27599. æD pascal OSErr HSetFLock(short vRefNum,long dirID,const Str255 fileName); 
  27600. æDT OSErr myVariable = HSetFLock((short) vRefNum,(long) dirID,(const Str255) fileName);
  27601. æRI IV-151, VI
  27602. æC 
  27603. HSetFLock locks a file: no new access paths to it can be created. It is an HFS
  27604. version of the MFS function SetFLock. It calls the function PBHSetFLock,
  27605. documented in the File Manager chapter of Volume IV.
  27606.  
  27607. Trap macro  _HSetFLock
  27608.  
  27609. Parameter block
  27610.     —>  12  ioCompletion    pointer
  27611.     <—  16  ioResult        word
  27612.     —>  18  ioNamePtr       pointer
  27613.     —>  22  ioVRefNum       word
  27614.     —>  48  ioDirID         long word
  27615.  
  27616.     PBHSetFLock is identical to PBSetFLock except that it accepts a
  27617. directory ID in ioDirID.
  27618.  
  27619. Result codes
  27620.  
  27621.     noErr       No error
  27622.     dirNFErr    Directory not found or incomplete pathname
  27623.     extFSErr    External file system
  27624.     fnfErr      File not found
  27625.     ioErr       I/O error
  27626.     nsvErr      No such volume
  27627.     vLckdErr    Software volume lock
  27628.     wPrErr      Hardware volume lock
  27629.  
  27630. æKY HRstFLock
  27631. æFc Files.h
  27632. æT Function
  27633. æD pascal OSErr HRstFLock(short vRefNum,long dirID,const Str255 fileName); 
  27634. æDT OSErr myVariable = HRstFLock((short) vRefNum,(long) dirID,(const Str255) fileName);
  27635. æRI IV-152, VI
  27636. æC 
  27637. HRstFLock unlocks a file. It is an HFS version of the MFS function RstFLock. It
  27638. calls the function PBHRstFLock, documented in the File Manager chapter of Volume
  27639. IV.
  27640.  
  27641. Trap macro  _HRstFLock
  27642.  
  27643. Parameter block
  27644.     —>  12  ioCompletion    pointer
  27645.     <—  16  ioResult        word
  27646.     —>  18  ioNamePtr       pointer
  27647.     —>  22  ioVRefNum       word
  27648.     —>  48  ioDirID         long word
  27649.  
  27650.     PBHRstFLock is identical to PBRstFLock except that it accepts a
  27651. directory ID in ioDirID.
  27652.  
  27653. Result codes
  27654.  
  27655.     noErr       No error
  27656.     dirNFErr    Directory not found or incomplete pathname
  27657.     extFSErr    External file system
  27658.     fnfErr      File not found
  27659.     ioErr       I/O error
  27660.     nsvErr      No such volume
  27661.     vLckdErr    Software volume lock
  27662.     wPrErr      Hardware volume lock
  27663.  
  27664. æKY HRename
  27665. æFc Files.h
  27666. æT Function
  27667. æD pascal OSErr HRename(short vRefNum,long dirID,const Str255 oldName,const Str255 newName); 
  27668. æDT OSErr myVariable = HRename((short) vRefNum,(long) dirID,(const Str255) oldName,(const Str255) newName);
  27669. æRI IV-154, VI
  27670. æC 
  27671. HRename changes the name of a file or directory. It is an HFS version of the MFS
  27672. function Rename. It calls the function PBHRename, documented in the File Manager
  27673. chapter of Volume IV.
  27674.  
  27675. Trap macro  _Rename
  27676.  
  27677. Parameter block
  27678.     —>  12  ioCompletion    pointer
  27679.     <—  16  ioResult        word
  27680.     —>  18  ioNamePtr       pointer
  27681.     —>  22  ioVRefNum       word
  27682.     —>  26  ioVersNum       byte
  27683.     —>  28  ioMisc          pointer
  27684.  
  27685.     Given a pointer to a file name in ioNamePtr (and on flat volumes, a
  27686. version number in ioVersNum), PBRename changes the name of the file to
  27687. the name pointed to by ioMisc. (If the name pointed to by ioNamePtr
  27688. contains one or more colons, so must the name pointed to by ioMisc.)
  27689. Access paths currently in use aren’t affected. Given a pointer to a
  27690. volume name in ioNamePtr or a volume reference number in ioVRefNum, it
  27691. changes the name of the volume to the name pointed to by ioMisc. If a
  27692. volume to be renamed is specified by its volume reference number,
  27693. ioNamePtr can be NIL.
  27694.  
  27695. Warning:
  27696.  
  27697.     If a volume to be renamed is specified by its volume name, be
  27698.     sure that it ends with a colon, or Rename will consider it a
  27699.     file name.
  27700.  
  27701. Result codes
  27702.  
  27703.     noErr       No error
  27704.     bdNamErr    Bad file name
  27705.     dirFulErr   File directory full
  27706.     dupFNErr    Duplicate file name and version
  27707.     extFSErr    External file system
  27708.     fLckdErr    File locked
  27709.     fnfErr      File not found
  27710.     fsRnErr     Problem during rename
  27711.     ioErr       I/O error
  27712.     nsvErr      No such volume
  27713.     paramErr    No default volume
  27714.     vLckdErr    Software volume lock
  27715.     wPrErr      Hardware volume lock
  27716.  
  27717. æKY CatMove
  27718. æFc Files.h
  27719. æT Function
  27720. æD pascal OSErr CatMove(short vRefNum,long dirID,const Str255 oldName,long newDirID,
  27721.     const Str255 newName); 
  27722. æDT OSErr myVariable = CatMove((short) vRefNum,(long) dirID,(const Str255) oldName,(long) newDirID,(
  27723.     const) Str255 newName);
  27724. æRT 218
  27725. æRI IV-157, VI
  27726. æC 
  27727. CatMove is a high-level function that calls PBCatMove.
  27728.  
  27729. Trap macro  _CatMove
  27730.  
  27731. Parameter block
  27732.     —>  12  ioCompletion    pointer
  27733.     <—  16  ioResult        word
  27734.     —>  18  ioNamePtr       pointer
  27735.     —>  22  ioVRefNum       word
  27736.     —>  28  ioNewName       pointer
  27737.     —>  36  ioNewDirID      long word
  27738.     —>  48  ioDirID         long word
  27739.  
  27740.     PBCatMove moves files or directories from one directory to another.
  27741. The name of the file or directory to be moved is pointed to by
  27742. ioNamePtr; ioVRefNum contains either the volume reference number or
  27743. working directory reference number. A directory ID can be specified in
  27744. ioDirID. The name and directory ID of the directory to which the file
  27745. or directory is to be moved are specified by ioNewName and ioNewDirID.
  27746.  
  27747.     PBCatMove is strictly a file catalog operation; it does not actually
  27748. change the location of the file or directory on the disk. PBCatMove
  27749. cannot move a file or directory to another volume (that is, ioVRefNum is
  27750. used in specifying both the source and the destination). It also cannot
  27751. be used to rename files or directories; for that, use PBHRename.
  27752.  
  27753. Result codes
  27754.  
  27755.     noErr       No error
  27756.     badMovErr   Attempt to move into offspring
  27757.     bdNamErr    Bad file name or attempt to move into a file
  27758.     dupFNErr    Duplicate file name and version
  27759.     fnfErr      File not found
  27760.     ioErr       I/O error
  27761.     nsvErr      No such volume
  27762.     paramErr    No default volume
  27763.     vLckdErr    Software volume lock
  27764.     wPrErr      Hardware volume lock
  27765.  
  27766. æKY OpenWD
  27767. æFc Files.h
  27768. æT Function
  27769. æD pascal OSErr OpenWD(short vRefNum,long dirID,long procID,short *wdRefNum); 
  27770. æDT OSErr myVariable = OpenWD((short) vRefNum,(long) dirID,(long) procID,(short *) wdRefNum);
  27771. æRT 218
  27772. æRI IV-158, VI
  27773. æC 
  27774. OpenWD is a high-level function that calls PBOpenWD.
  27775.  
  27776. Trap macro  _OpenWD
  27777.  
  27778. Parameter block
  27779.     —>  12  ioCompletion    pointer
  27780.     <—  16  ioResult        word
  27781.     —>  18  ioNamePtr       pointer
  27782.     <–> 22  ioVRefNum       word
  27783.     —>  28  ioWDProcID      long word
  27784.     —>  48  ioWDDirID       long word
  27785.  
  27786.     PBOpenWD takes the directory specified by ioVRefNum, ioWDDirID, and
  27787. ioWDProcID and makes it a working directory. (You can also specify the
  27788. directory using a combination of partial pathname and directory ID.)  It
  27789. returns a working directory reference number in ioVRefNum that can be
  27790. used in subsequent calls.
  27791.  
  27792.     If a given directory has already been made a working directory using
  27793. the same ioWDProcID, no new working directory will be opened; instead,
  27794. the existing working directory reference number will be returned. If a
  27795. given directory was already made a working directory using a different
  27796. ioWDProcID, a new working directory reference number is returned.
  27797.  
  27798. Result codes
  27799.  
  27800.     noErr       No error
  27801.     tmwdoErr    Too many working directories open
  27802.  
  27803. æKY CloseWD
  27804. æFc Files.h
  27805. æT Function
  27806. æD pascal OSErr CloseWD(short wdRefNum); 
  27807. æDT OSErr myVariable = CloseWD((short) wdRefNum);
  27808. æRT 218
  27809. æRI IV-158, VI
  27810. æC
  27811. CloseWD is a high-level function that calls PBCloseWD.
  27812.  
  27813. Trap macro  _CloseWD
  27814.  
  27815. Parameter block
  27816.     —>  12  ioCompletion    pointer
  27817.     <—  16  ioResult        word
  27818.     —>  22  ioVRefNum       word
  27819.  
  27820.     PBCloseWD releases the working directory whose working directory
  27821. reference number is specified in ioVRefNum.
  27822.  
  27823. Note:  
  27824.  
  27825.     If a volume reference number is specified in ioVRefNum, PBCloseWD
  27826.     does nothing.
  27827.  
  27828. Result codes
  27829.  
  27830.     noErr   No error
  27831.     nsvErr  No such volume
  27832.  
  27833. æKY GetWDInfo
  27834. æFc Files.h
  27835. æT Function
  27836. æD pascal OSErr GetWDInfo(short wdRefNum,short *vRefNum,long *dirID,long *procID); 
  27837. æDT OSErr myVariable = GetWDInfo((short) wdRefNum,(short *) vRefNum,(long *) dirID,(long *) procID);
  27838. æRT 218
  27839. æRI IV-159, VI
  27840. æC 
  27841. GetWDInfo is a high-level function that calls PBGetWDInfo.
  27842.  
  27843. Trap macro  _GetWDInfo
  27844.  
  27845. Parameter block
  27846.     —>  12  ioCompletion    pointer
  27847.     <—  16  ioResult        word
  27848.     <—  18  ioNamePtr       pointer
  27849.     <–> 22  ioVRefNum       word
  27850.     —>  26  ioWDIndex       word
  27851.     <–> 28  ioWDProcID      long word
  27852.     <–> 32  ioWDVRefNum     word
  27853.     <—  48  ioWDDirID       long word
  27854.  
  27855.     PBGetWDInfo returns information about the specified working
  27856. directory. The working directory can be specified either by its working
  27857. directory reference number in ioVRefNum (in which case ioWDIndex should
  27858. be 0), or by its index number in ioWDIndex. In the latter case, if
  27859. ioVRefNum is nonzero, it’s interpreted as a volume specification (volume
  27860. reference number or drive number), and only working directories on that
  27861. volume are indexed.
  27862.  
  27863.     IOWDVRefNum always returns the volume reference number. IOVRefNum
  27864. returns a working directory reference number when a working directory
  27865. reference number is passed in that field; otherwise, it returns a volume
  27866. reference number. The volume name is returned in ioNamePtr.
  27867.  
  27868.     If IOWDProcID is nonzero, only working directories with that
  27869. identifier are indexed; otherwise all working directories are indexed.
  27870.  
  27871. Result codes
  27872.  
  27873.     noErr   No error
  27874.     nsvErr  No such volume
  27875.  
  27876. æKY PBExchangeFiles
  27877. æFc Files.h
  27878. æT Function
  27879. æD pascal OSErr PBExchangeFiles(HParmBlkPtr paramBlock,Boolean async); 
  27880. æDT OSErr myVariable = PBExchangeFiles((HParmBlkPtr) paramBlock,(Boolean) async);
  27881. æC 
  27882. Parameter Block 
  27883. ¨   16  ioResult       word
  27884. Æ   18  ioNamePtr      string pointer
  27885. Æ   22  ioVRefNum      word
  27886. Æ   28  ioDestNamePtr  string pointer
  27887. Æ   36  ioDestDirID    long
  27888. Æ   48  ioSrcDirID     long
  27889.  
  27890. You should use PBExchangeFiles if your application needs to preserve the file ID
  27891. after moving the data into a new file. Typically, you use PBExchangeFiles after
  27892. creating a new file during a safe save. You must specify both files, which must
  27893. exist on the same volume. The file specified by [ioDestDirID, ioDestNamePtr] is
  27894. exchanged with the file specified by [ioSrcDirID, ioNamePtr]. Both forks of the
  27895. files are exchanged. Modification dates in the catalog record are exchanged,
  27896. along with the fields accessed by HFS to locate the data of the files. All other
  27897. catalog information remains unchanged.
  27898.  
  27899. PBExchangeFiles works on either open or closed files. If either file is open,
  27900. PBExchangeFiles updates any file control blocks associated with the file.
  27901.  
  27902. PBExchangeFiles does not require that file IDs exist for the files being
  27903. exchanged.
  27904.  
  27905. Result codes:
  27906.  
  27907. extFSErr          -58  External file system
  27908. ioErr             -36  I/O error
  27909. nsvErr            -35  No such volume
  27910. fnfErr            -43  File not found
  27911. fLckdErr          -45  One or both files locked
  27912. volOfflinErr      -53  Volume is off-line
  27913. wrgVolTypeErr    -123  Not an HFS volume
  27914. fidNotFoundErr  -1300  File not found
  27915. fidExists       -1301  File ID already exists
  27916. notAFileErr     -1302  Specified file is a directory
  27917. diffVolErr      -xxxx  Volume specifications in pathnames are not equivalent
  27918.  
  27919. æKY PBCreateFileID
  27920. æFc Files.h
  27921. æT Function
  27922. æD pascal OSErr PBCreateFileID(HParmBlkPtr paramBlock,Boolean async); 
  27923. æDT OSErr myVariable = PBCreateFileID((HParmBlkPtr) paramBlock,(Boolean) async);
  27924. æC 
  27925. Parameter Block 
  27926.   ¨   16  ioResult    word
  27927.   Æ   18  ioNamePtr   string pointer
  27928.   Æ   22  ioVRefNum   word
  27929.   Æ   48  ioSrcDirID  long
  27930.   ¨   54  ioFileID    long 
  27931.  
  27932. Given a volume reference number, file name, and parent directory ID,
  27933. PBCreateFileID creates a record to hold the name and parent directory ID of the
  27934. specified file. The actual value of the file ID is the same as the file number
  27935. stored in the file record. If a file ID already exists for the file, the ID
  27936. value is returned in ioFileID.
  27937.  
  27938. Result codes
  27939. extFSErr          -58  External file system
  27940. ioErr             -36  I/O error
  27941. nsvErr            -35  No such volume
  27942. volOfflinErr      -53  Volume is offline
  27943. vLckdErr          -46  Software volume lock
  27944. wPrErr            -44  Hardware volume lock
  27945. wrgVolTypeErr    -123  Not an HFS volume
  27946. fidNotFoundErr  -1300  File not found
  27947. fidExists       -1301  File ID already exists
  27948. notAFileErr     -1302  Specified file is a directory
  27949.  
  27950. æKY PBResolveFileID
  27951. æFc Files.h
  27952. æT Function
  27953. æD 
  27954. pascal OSErr PBResolveFileID(HParmBlkPtr paramBlock,Boolean async); 
  27955. æDT OSErr myVariable = PBResolveFileID((HParmBlkPtr) paramBlock,(Boolean) async);
  27956. æC 
  27957. Parameter Block 
  27958.   ¨   16  ioResult    word
  27959.   ´   18  ioNamePtr   string pointer
  27960.   Æ   22  ioVRefNum   word
  27961.   ¨   48  ioSrcDirID  long
  27962.   Æ   54  ioFileID    long 
  27963.  
  27964. PBResolveFileID returns the filename and parent directory ID of the file
  27965. referred to by file ID in the ioFileID field. It places the filename in the
  27966. string pointed to by ioNamePtr and the directory ID in ioSrcDirID. You must
  27967. allocate memory <how much?> for the string before you make the call. If the name
  27968. string is NIL, PBResolveFileID returns only the parent directory ID. If the name
  27969. string is not NIL but is only a volume name, PBResolveFileID ignores the value
  27970. in ioVRefNum, uses the volume name instead, and overwrites the name string with
  27971. the filename. A return code of fidNotFound means that the specified file ID has
  27972. become invalid either because the file was deleted or the file ID was destroyed
  27973. by PBDeleteFileID.
  27974.  
  27975. Result codes:
  27976.  
  27977. extFSErr          -58  External file system
  27978. ioErr             -36  I/O error
  27979. nsvErr            -35  No such volume
  27980. volOfflinErr      -53  Volume is off-line
  27981. wrgVolTypeErr    -123  Not an HFS volume
  27982. fidNotFoundErr  -1300  File ID not found
  27983. fidExists       -1301  File ID already exists
  27984. notAFileErr     -1302  Specified file is a directory
  27985.  
  27986. æKY PBDeleteFileID
  27987. æFc Files.h
  27988. æT Function
  27989. æD pascal OSErr PBDeleteFileID(HParmBlkPtr paramBlock,Boolean async); 
  27990. æDT OSErr myVariable = PBDeleteFileID((HParmBlkPtr) paramBlock,(Boolean) async);
  27991. æC 
  27992. Parameter Block 
  27993.   ¨   16  ioResult   word
  27994.   Æ   18  ioNamePtr  string pointer
  27995.   Æ   22  ioVRefNum  word
  27996.   Æ   54  ioFileID   long 
  27997.  
  27998. PBDeleteFileID invalidates a file ID on the volume specified by ioVRefNum or
  27999. ioNamePtr. After it has invalidated a file ID, the File Manager can no longer
  28000. resolve it to a filename and parent directory ID. The file ID is invalidated
  28001. whether or not the target file referenced by that ID still exists.
  28002.  
  28003. Result codes:
  28004.  
  28005. extFSErr          -58  External file system
  28006. ioErr             -36  I/O error
  28007. nsvErr            -35  No such volume
  28008. volOfflinErr      -53  Volume is offline
  28009. vLckdErr          -46  Software volume lock
  28010. wPrErr            -44  Hardware volume lock
  28011. wrgVolTypeErr    -123  Not an HFS volume
  28012. fidNotFoundErr  -1300  File ID not found
  28013. fidExists       -1301  File ID already exists
  28014. notAFileErr     -1302  Specified file is a directory
  28015.  
  28016. æKY PBDTGetPath
  28017. æFc Files.h
  28018. æT Function
  28019. æD pascal OSErr PBDTGetPath(DTPBPtr paramBlock,Boolean async); 
  28020. æDT OSErr myVariable = PBDTGetPath((DTPBPtr) paramBlock,(Boolean) async);
  28021. æC 
  28022.  
  28023. æKY PBDTCloseDown
  28024. æFc Files.h
  28025. æT Function
  28026. æD pascal OSErr PBDTCloseDown(DTPBPtr paramBlock,Boolean async); 
  28027. æDT OSErr myVariable = PBDTCloseDown((DTPBPtr) paramBlock,(Boolean) async);
  28028. æC 
  28029.  
  28030. æKY PBDTAddIcon
  28031. æFc Files.h
  28032. æT Function
  28033. æD pascal OSErr PBDTAddIcon(DTPBPtr paramBlock,Boolean async); 
  28034. æDT OSErr myVariable = PBDTAddIcon((DTPBPtr) paramBlock,(Boolean) async);
  28035. æRI 
  28036.  
  28037. æC 
  28038.  
  28039. æKY PBDTGetIcon
  28040. æFc Files.h
  28041. æT Function
  28042. æD pascal OSErr PBDTGetIcon(DTPBPtr paramBlock,Boolean async); 
  28043. æDT OSErr myVariable = PBDTGetIcon((DTPBPtr) paramBlock,(Boolean) async);
  28044. æRI 
  28045.  
  28046. æC 
  28047.  
  28048. æKY PBDTGetIconInfo
  28049. æFc Files.h
  28050. æT Function
  28051. æD pascal OSErr PBDTGetIconInfo(DTPBPtr paramBlock,Boolean async); 
  28052. æDT OSErr myVariable = PBDTGetIconInfo((DTPBPtr) paramBlock,(Boolean) async);
  28053. æRI 
  28054.  
  28055. æC 
  28056.  
  28057. æKY PBDTAddAPPL
  28058. æFc Files.h
  28059. æT Function
  28060. æD pascal OSErr PBDTAddAPPL(DTPBPtr paramBlock,Boolean async); 
  28061. æDT OSErr myVariable = PBDTAddAPPL((DTPBPtr) paramBlock,(Boolean) async);
  28062. æRI 
  28063.  
  28064. æC 
  28065.  
  28066. æKY PBDTRemoveAPPL
  28067. æFc Files.h
  28068. æT Function
  28069. æD pascal OSErr PBDTRemoveAPPL(DTPBPtr paramBlock,Boolean async); 
  28070. æDT OSErr myVariable = PBDTRemoveAPPL((DTPBPtr) paramBlock,(Boolean) async);
  28071. æRI 
  28072.  
  28073. æC 
  28074.  
  28075. æKY PBDTGetAPPL
  28076. æFc Files.h
  28077. æT Function
  28078. æD pascal OSErr PBDTGetAPPL(DTPBPtr paramBlock,Boolean async); 
  28079. æDT OSErr myVariable = PBDTGetAPPL((DTPBPtr) paramBlock,(Boolean) async);
  28080. æRI 
  28081.  
  28082. æC 
  28083.  
  28084. æKY PBDTSetComment
  28085. æFc Files.h
  28086. æT Function
  28087. æD pascal OSErr PBDTSetComment(DTPBPtr paramBlock,Boolean async); 
  28088. æDT OSErr myVariable = PBDTSetComment((DTPBPtr) paramBlock,(Boolean) async);
  28089. æC 
  28090.  
  28091. æKY PBDTRemoveComment
  28092. æFc Files.h
  28093. æT Function
  28094. æD pascal OSErr PBDTRemoveComment(DTPBPtr paramBlock,Boolean async); 
  28095. æDT OSErr myVariable = PBDTRemoveComment((DTPBPtr) paramBlock,(Boolean) async);
  28096. æRI 
  28097.  
  28098. æC 
  28099.  
  28100. æKY PBDTGetComment
  28101. æFc Files.h
  28102. æT Function
  28103. æD pascal OSErr PBDTGetComment(DTPBPtr paramBlock,Boolean async); 
  28104. æDT OSErr myVariable = PBDTGetComment((DTPBPtr) paramBlock,(Boolean) async);
  28105. æRI 
  28106.  
  28107. æC 
  28108.  
  28109. æKY PBDTFlush
  28110. æFc Files.h
  28111. æT Function
  28112. æD pascal OSErr PBDTFlush(DTPBPtr paramBlock,Boolean async); 
  28113. æDT OSErr myVariable = PBDTFlush((DTPBPtr) paramBlock,(Boolean) async);
  28114. æRI 
  28115.  
  28116. æC 
  28117.  
  28118. æKY PBDTReset
  28119. æFc Files.h
  28120. æT Function
  28121. æD pascal OSErr PBDTReset(DTPBPtr paramBlock,Boolean async); 
  28122. æDT OSErr myVariable = PBDTReset((DTPBPtr) paramBlock,(Boolean) async);
  28123. æRI 
  28124.  
  28125. æC 
  28126.  
  28127. æKY PBDTGetInfo
  28128. æFc Files.h
  28129. æT Function
  28130. æD pascal OSErr PBDTGetInfo(DTPBPtr paramBlock,Boolean async); 
  28131. æDT OSErr myVariable = PBDTGetInfo((DTPBPtr) paramBlock,(Boolean) async);
  28132. æRI 
  28133.  
  28134. æC 
  28135.  
  28136. æKY PBDTOpenInform
  28137. æFc Files.h
  28138. æT Function
  28139. æD pascal OSErr PBDTOpenInform(DTPBPtr paramBlock,Boolean async); 
  28140. æDT OSErr myVariable = PBDTOpenInform((DTPBPtr) paramBlock,(Boolean) async);
  28141. æRI 
  28142.  
  28143. æC 
  28144.  
  28145. æKY PBDTDelete
  28146. æFc Files.h
  28147. æT Function
  28148. æD pascal OSErr PBDTDelete(DTPBPtr paramBlock,Boolean async); 
  28149. æDT OSErr myVariable = PBDTDelete((DTPBPtr) paramBlock,(Boolean) async);
  28150. æRI 
  28151.  
  28152. æC 
  28153.  
  28154. æKY MakeFSSpec
  28155. æFc Files.h
  28156. æT Function
  28157. æD /*  FSSpec Glue  */
  28158. pascal OSErr MakeFSSpec(short vRefNum,long dirID,StringPtr fileName); 
  28159. æDT /*  FSSpec Glue  */
  28160. pascal OSErr myVariable = MakeFSSpec((short) vRefNum,(long) dirID,(StringPtr) fileName);
  28161. æRI VI
  28162. æC 
  28163. You use the MakeFSSpec function to establish the canonical form of the name for
  28164. a file, folder, or volume.
  28165.  
  28166. FUNCTION MakeFSSpec (vRefNum: Integer; dirID: LongInt; fileName: Str255; VAR
  28167.                      canonicalFile: CanonicalFileSpec) : OSErr;
  28168.  
  28169. MakeFSSpec places the canonical form of the specified file reference in the
  28170. CanonicalFileSpec parameter. (See “Identifying Files, Folders, and Volumes” for
  28171. a description of the FSSpec record.)
  28172.  
  28173. The vRefNum parameter is the volume reference number, a working directory
  28174. reference number, a drive number, or 0 for the default volume.
  28175.  
  28176. The dirID parameter is the parent directory ID of the target object. If the
  28177. directory is sufficiently specified by either vRefNum or fileName, dirID can be
  28178. 0. If you explicitly specify dirID (that is, if it is any value other than 0),
  28179. and if vRefNum is a working directory reference number, dirID overrides the
  28180. directory ID included in vRefNum.
  28181.  
  28182. The fileName parameter is a full or partial pathname. If it is a full pathname,
  28183. MakeFSSpec ignores vRefNum and dirID. A partial pathname might identify only the
  28184. final target, or it might include one or more parent folder names. If fileName
  28185. is a partial pathname, vRefNum, dirID, or both must be valid.
  28186.  
  28187. You can pass the input to MakeFSSpec in any of the four ways described in 
  28188. “Identifying Files, Folders, and Volumes” earlier in this chapter. See “Using
  28189. the File Manager” for a summary of the how MakeFSSpec accepts input and how it
  28190. fills in the FSSpec record for files, folders, and volumes.
  28191.  
  28192. In addition to the result code listed here, MakeFSSpec can return a number of
  28193. different File Manager or Memory Manager error codes.
  28194.  
  28195. Result codes
  28196. paramErr  -50  Output is NIL
  28197.  
  28198. æKY FSpOpenDF
  28199. æFc Files.h
  28200. æT Function
  28201. æD 
  28202. pascal OSErr FSpOpenDF(FSSpecPtr spec,char permission,short *refNum); 
  28203. æDT OSErr myVariable = FSpOpenDF((FSSpecPtr) spec,(char) permission,(short *) refNum);
  28204. æRI 
  28205.  
  28206. æC 
  28207.  
  28208. æKY FSpOpenRF
  28209. æFc Files.h
  28210. æT Function
  28211. æD 
  28212. pascal OSErr FSpOpenRF(FSSpecPtr spec,char permission,short *refNum); 
  28213. æDT OSErr myVariable = FSpOpenRF((FSSpecPtr) spec,(char) permission,(short *) refNum);
  28214. æRI 
  28215.  
  28216. æC 
  28217.  
  28218. æKY FSpCreate
  28219. æFc Files.h
  28220. æT Function
  28221. æD 
  28222. pascal OSErr FSpCreate(FSSpecPtr spec,OSType creator,OSType fileType); 
  28223. æDT OSErr myVariable = FSpCreate((FSSpecPtr) spec,(OSType) creator,(OSType) fileType);
  28224. æRI 
  28225.  
  28226. æC 
  28227.  
  28228. æKY FSpDirCreate
  28229. æFc Files.h
  28230. æT Function
  28231. æD 
  28232. pascal OSErr FSpDirCreate(FSSpecPtr spec,long *createdDirID); 
  28233. æDT OSErr myVariable = FSpDirCreate((FSSpecPtr) spec,(long *) createdDirID);
  28234. æRI 
  28235.  
  28236. æC 
  28237.  
  28238. æKY FSpDelete
  28239. æFc Files.h
  28240. æT Function
  28241. æD 
  28242. pascal OSErr FSpDelete(FSSpecPtr spec); 
  28243. æDT OSErr myVariable = FSpDelete((FSSpecPtr) spec);
  28244. æRI 
  28245.  
  28246. æC 
  28247.  
  28248. æKY FSpGetFInfo
  28249. æFc Files.h
  28250. æT Function
  28251. æD 
  28252. pascal OSErr FSpGetFInfo(FSSpecPtr spec,FInfo *fndrInfo); 
  28253. æDT OSErr myVariable = FSpGetFInfo((FSSpecPtr) spec,(FInfo *) fndrInfo);
  28254. æRI 
  28255.  
  28256. æC 
  28257.  
  28258. æKY FSpSetFInfo
  28259. æFc Files.h
  28260. æT Function
  28261. æD 
  28262. pascal OSErr FSpSetFInfo(FSSpecPtr spec,FInfo *fndrInfo); 
  28263. æDT OSErr myVariable = FSpSetFInfo((FSSpecPtr) spec,(FInfo *) fndrInfo);
  28264. æRI 
  28265.  
  28266. æC 
  28267.  
  28268. æKY FSpSetFLock
  28269. æFc Files.h
  28270. æT Function
  28271. æD 
  28272. pascal OSErr FSpSetFLock(FSSpecPtr spec); 
  28273. æDT OSErr myVariable = FSpSetFLock((FSSpecPtr) spec);
  28274. æRI 
  28275.  
  28276. æC 
  28277.  
  28278. æKY FSpRstFLock
  28279. æFc Files.h
  28280. æT Function
  28281. æD 
  28282. pascal OSErr FSpRstFLock(FSSpecPtr spec); 
  28283. æDT OSErr myVariable = FSpRstFLock((FSSpecPtr) spec);
  28284. æRI 
  28285.  
  28286. æC 
  28287.  
  28288. æKY FSpRename
  28289. æFc Files.h
  28290. æT Function
  28291. æD 
  28292. pascal OSErr FSpRename(FSSpecPtr spec,StringPtr newName); 
  28293. æDT OSErr myVariable = FSpRename((FSSpecPtr) spec,(StringPtr) newName);
  28294. æRI 
  28295.  
  28296. æC 
  28297.  
  28298. æKY FSpCatMove
  28299. æFc Files.h
  28300. æT Function
  28301. æD 
  28302. pascal OSErr FSpCatMove(FSSpecPtr source,FSSpecPtr dest); 
  28303. æDT OSErr myVariable = FSpCatMove((FSSpecPtr) source,(FSSpecPtr) dest);
  28304. æRI 
  28305.  
  28306. æC 
  28307.  
  28308. æKY FSpOpenResFile
  28309. æFc Files.h
  28310. æT Function
  28311. æD 
  28312. pascal short FSpOpenResFile(FSSpecPtr spec,char permission); 
  28313. æDT short myVariable = FSpOpenResFile((FSSpecPtr) spec,(char) permission);
  28314. æRI 
  28315.  
  28316. æC 
  28317.  
  28318. æKY FSpCreateResFile
  28319. æFc Files.h
  28320. æT Function
  28321. æD 
  28322. pascal void FSpCreateResFile(FSSpecPtr spec); 
  28323. æDT 
  28324. FSpCreateResFile((FSSpecPtr) spec);
  28325. æRI 
  28326.  
  28327. æC 
  28328.  
  28329.  
  28330. æKY FixMath.h
  28331. æKL Fix2Frac
  28332. Fix2Long
  28333. Fix2X
  28334. FixATan2
  28335. FixDiv
  28336. Frac2Fix
  28337. Frac2X
  28338. FracCos
  28339. FracDiv
  28340. FracMul
  28341. FracSin
  28342. FracSqrt
  28343. Long2Fix
  28344. X2Fix
  28345. X2Frac
  28346.  
  28347.  
  28348. æKY Fix2Frac
  28349. æFc FixMath.h
  28350. æT Function
  28351. æTN A841
  28352. æD pascal Fract Fix2Frac(Fixed x)
  28353.     = 0xA841; 
  28354. æDT Fract myVariable = Fix2Frac((Fixed) x);
  28355. æRI IV-65
  28356. æC 
  28357. Long2Fix, Fix2Long, Fix2Frac, and Frac2Fix convert between fixed-point types.
  28358.  
  28359. Examples
  28360.  
  28361. Examples of the use of these fixed-point functions are provided below; all numbers
  28362. are decimal unless otherwise noted.
  28363.  
  28364. Function                                 Result      Comment
  28365. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28366. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28367. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28368. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28369. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28370. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28371. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28372. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28373. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28374. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28375. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28376. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28377. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28378. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28379. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28380. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28381. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28382. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28383. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28384.  
  28385. æKY Fix2Long
  28386. æFc FixMath.h
  28387. æT Function
  28388. æTN A840
  28389. æD pascal long Fix2Long(Fixed x)
  28390.     = 0xA840; 
  28391. æDT long myVariable = Fix2Long((Fixed) x);
  28392. æRI IV-65
  28393. æC 
  28394. Long2Fix, Fix2Long, Fix2Frac, and Frac2Fix convert between fixed-point types.
  28395.  
  28396. Examples
  28397.  
  28398. Examples of the use of these fixed-point functions are provided below; all numbers
  28399. are decimal unless otherwise noted.
  28400.  
  28401. Function                                 Result      Comment
  28402. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28403. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28404. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28405. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28406. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28407. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28408. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28409. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28410. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28411. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28412. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28413. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28414. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28415. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28416. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28417. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28418. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28419. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28420. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28421.  
  28422. æKY FixATan2
  28423. æFc FixMath.h
  28424. æT Function
  28425. æTN A818
  28426. æD pascal Fixed FixATan2(long x,long y)
  28427.     = 0xA818; 
  28428. æDT Fixed myVariable = FixATan2((long) x,(long) y);
  28429. æRI IV-65
  28430. æC 
  28431. FixATan2 returns the arctangent of y / x in radians. Note that FixATan2 effects
  28432. “arctan(type / type) --> Fixed”:
  28433.  
  28434.   arctan(LONGINT / LONGINT)  -->    Fixed
  28435.   arctan(Fixed / Fixed)      -->    Fixed
  28436.   arctan(Fract / Fract)      -->    Fixed
  28437.  
  28438. æKY Long2Fix
  28439. æFc FixMath.h
  28440. æT Function
  28441. æTN A83F
  28442. æD pascal Fixed Long2Fix(long x)
  28443.     = 0xA83F; 
  28444. æDT Fixed myVariable = Long2Fix((long) x);
  28445. æRI IV-65
  28446. æC 
  28447. Long2Fix, Fix2Long, Fix2Frac, and Frac2Fix convert between fixed-point types.
  28448.  
  28449. Examples
  28450.  
  28451. Examples of the use of these fixed-point functions are provided below; all numbers
  28452. are decimal unless otherwise noted.
  28453.  
  28454. Function                                 Result      Comment
  28455. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28456. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28457. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28458. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28459. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28460. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28461. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28462. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28463. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28464. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28465. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28466. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28467. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28468. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28469. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28470. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28471. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28472. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28473. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28474.  
  28475. æKY Frac2Fix
  28476. æFc FixMath.h
  28477. æT Function
  28478. æTN A842
  28479. æD pascal Fixed Frac2Fix(Fract x)
  28480.     = 0xA842; 
  28481. æDT Fixed myVariable = Frac2Fix((Fract) x);
  28482. æRI IV-65
  28483. æC 
  28484. Long2Fix, Fix2Long, Fix2Frac, and Frac2Fix convert between fixed-point types.
  28485.  
  28486. Examples
  28487.  
  28488. Examples of the use of these fixed-point functions are provided below; all numbers
  28489. are decimal unless otherwise noted.
  28490.  
  28491. Function                                 Result      Comment
  28492. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28493. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28494. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28495. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28496. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28497. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28498. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28499. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28500. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28501. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28502. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28503. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28504. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28505. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28506. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28507. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28508. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28509. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28510. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28511.  
  28512. æKY Frac2X
  28513. æFc FixMath.h
  28514. æT Function
  28515. æD pascal extended Frac2X(Fract x); 
  28516. æDT extended myVariable = Frac2X((Fract) x);
  28517. æRI IV-65
  28518. æC 
  28519. Fix2X, X2Fix, Frac2X, and X2Frac convert between Fixed and Fract and the Extended
  28520. floating-point type. These functions do not set floating-point exception flags.
  28521.  
  28522. Examples
  28523.  
  28524. Examples of the use of these fixed-point functions are provided below; all numbers
  28525. are decimal unless otherwise noted.
  28526.  
  28527. Function                                 Result      Comment
  28528. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28529. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28530. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28531. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28532. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28533. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28534. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28535. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28536. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28537. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28538. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28539. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28540. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28541. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28542. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28543. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28544. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28545. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28546. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28547.  
  28548. æKY Fix2X
  28549. æFc FixMath.h
  28550. æT Function
  28551. æD pascal extended Fix2X(Fixed x); 
  28552. æDT extended myVariable = Fix2X((Fixed) x);
  28553. æRI IV-65
  28554. æC 
  28555. Fix2X, X2Fix, Frac2X, and X2Frac convert between Fixed and Fract and the Extended
  28556. floating-point type. These functions do not set floating-point exception flags.
  28557.  
  28558. Examples
  28559.  
  28560. Examples of the use of these fixed-point functions are provided below; all numbers
  28561. are decimal unless otherwise noted.
  28562.  
  28563. Function                                 Result      Comment
  28564. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28565. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28566. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28567. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28568. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28569. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28570. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28571. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28572. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28573. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28574. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28575. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28576. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28577. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28578. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28579. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28580. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28581. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28582. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28583.  
  28584. æKY X2Fix
  28585. æFc FixMath.h
  28586. æT Function
  28587. æD pascal Fixed X2Fix(extended x); 
  28588. æDT Fixed myVariable = X2Fix((extended) x);
  28589. æRI IV-65
  28590. æC 
  28591. Fix2X, X2Fix, Frac2X, and X2Frac convert between Fixed and Fract and the Extended
  28592. floating-point type. These functions do not set floating-point exception flags.
  28593.  
  28594. Examples
  28595.  
  28596. Examples of the use of these fixed-point functions are provided below; all numbers
  28597. are decimal unless otherwise noted.
  28598.  
  28599. Function                                 Result      Comment
  28600. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28601. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28602. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28603. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28604. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28605. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28606. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28607. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28608. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28609. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28610. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28611. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28612. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28613. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28614. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28615. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28616. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28617. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28618. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28619.  
  28620. æKY X2Frac
  28621. æFc FixMath.h
  28622. æT Function
  28623. æD pascal Fract X2Frac(extended x); 
  28624. æDT Fract myVariable = X2Frac((extended) x);
  28625. æRI IV-65
  28626. æC 
  28627. Fix2X, X2Fix, Frac2X, and X2Frac convert between Fixed and Fract and the Extended
  28628. floating-point type. These functions do not set floating-point exception flags.
  28629.  
  28630. Examples
  28631.  
  28632. Examples of the use of these fixed-point functions are provided below; all numbers
  28633. are decimal unless otherwise noted.
  28634.  
  28635. Function                                 Result      Comment
  28636. FixDiv    (X2Fix(1.95), X2Fix(1.30))     $00018000    1.5 = 01.10 bin
  28637. FracDiv   (X2Frac(1.95), X2Frac(1.30))   $60000000    1.5 = 01.10 bin
  28638. FracMul   (X2Frac(1.50), X2Frac(1.30))   $7CCCCCCD    1.95 rounded
  28639. FracSqrt  (X2Frac(1.96))                 $5999999A    1.4 rounded
  28640. FracSin   (X2Fix(3.1416015625))          $00000000    0
  28641. FracCos   (X2Fix(3.1416015625))          $C0000000   -1
  28642. Fix2Long  (X2Fix(1.75))                  $00000002    2
  28643. Fix2Frac  (X2Fix(1.75))                  $70000000    1.75 = 01.11 bin
  28644. Frac2Fix  (X2Frac(1.75))                 $0001C000    1.75 = 01.11 bin
  28645. FixATan2  (X2Fix(1.00), X2Fix(1.00))     $0000C910    0.C910 hex = X2Fix (π/4)
  28646. FixDiv    (X2Fix(-1.95), X2Fix(1.30))    $FFFE8000   -1.5
  28647. FracDiv   (X2Frac(-1.95), X2Frac(1.30))  $A0000000   -1.5
  28648. FracMul   (X2Frac(-1.50), X2Frac(1.30))  $83333333   -1.95 rounded
  28649. FracSin   (X2Fix(-3.1416015625))         $00000000    0
  28650. FracCos   (X2Fix(-3.1416015625))         $C0000000   -1
  28651. Fix2Long  (X2Fix(-1.75))                 $FFFFFFFE   -2
  28652. Fix2Frac  (X2Fix(-1.75))                 $90000000   -1.75
  28653. Frac2Fix  (X2Frac(-1.75))                $FFFE4000   -1.75
  28654. FixATan2  (X2Fix(-1.00), X2Fix(-1.00))   $FFFDA4D0   -3*X2Fix(π/4)=3*0.C910 hex
  28655.  
  28656. æKY FracMul
  28657. æFc FixMath.h
  28658. æT Function
  28659. æTN A84A
  28660. æD pascal Fract FracMul(Fract x,Fract y)
  28661.     = 0xA84A; 
  28662. æDT Fract myVariable = FracMul((Fract) x,(Fract) y);
  28663. æRI IV-64
  28664. æC 
  28665. FracMul returns x * y. Note that FracMul effects “type * Fract --> type”:
  28666.  
  28667.   Fract    *    Fract    -->    Fract
  28668.   LONGINT  *    Fract    -->    LONGINT
  28669.   Fract    *    LONGINT  -->    LONGINT
  28670.   Fixed    *    Fract    -->    Fixed
  28671.   Fract    *    Fixed    -->    Fixed
  28672.  
  28673. æKY FixDiv
  28674. æFc FixMath.h
  28675. æT Function
  28676. æTN A84D
  28677. æD pascal Fixed FixDiv(Fixed x,Fixed y)
  28678.     = 0xA84D; 
  28679. æDT Fixed myVariable = FixDiv((Fixed) x,(Fixed) y);
  28680. æRI IV-64
  28681. æC 
  28682. FixDiv returns x / y. Note that FixDiv effects “type / type --> Fixed” and
  28683. “type / Fixed --> type”:
  28684.  
  28685.   Fixed    /    Fixed    -->    Fixed
  28686.   LONGINT  /    LONGINT  -->    Fixed
  28687.   Fract    /    Fract    -->    Fixed
  28688.   LONGINT  /    Fixed    -->    LONGINT
  28689.   Fract    /    Fixed    -->    Fract
  28690.  
  28691. æKY FracDiv
  28692. æFc FixMath.h
  28693. æT Function
  28694. æTN A84B
  28695. æD pascal Fract FracDiv(Fract x,Fract y)
  28696.     = 0xA84B; 
  28697. æDT Fract myVariable = FracDiv((Fract) x,(Fract) y);
  28698. æRI IV-64
  28699. æC 
  28700. FracDiv returns x / y. Note that FracDiv effects “type / type --> Fract” and
  28701. “type / Fract --> type”:
  28702.  
  28703.   Fract    /    Fract    -->    Fract
  28704.   LONGINT  /    LONGINT  -->    Fract
  28705.   Fixed    /    Fixed    -->    Fract
  28706.   LONGINT  /    Fract    -->    LONGINT
  28707.   Fixed    /    Fract    -->    Fixed
  28708.  
  28709. æKY FracSqrt
  28710. æFc FixMath.h
  28711. æT Function
  28712. æTN A849
  28713. æD pascal Fract FracSqrt(Fract x)
  28714.     = 0xA849; 
  28715. æDT Fract myVariable = FracSqrt((Fract) x);
  28716. æRI IV-64
  28717. æC  
  28718. FracSqrt returns the square root of x, with x interpreted as unsigned in the range 0
  28719. through 4–(2–30), inclusive:  That is, bit 15 in Figure 1 has weight 2 rather than
  28720. –2. The result, too, is unsigned in the range 0 through 2, inclusive.
  28721.  
  28722. æKY FracSin
  28723. æFc FixMath.h
  28724. æT Function
  28725. æTN A848
  28726. æD pascal Fract FracSin(Fixed x)
  28727.     = 0xA848; 
  28728. æDT Fract myVariable = FracSin((Fixed) x);
  28729. æRI IV-64
  28730. æC 
  28731. FracCos and FracSin return the cosine and sine of their radian arguments, respectively.
  28732. The hexadecimal value 0.C910 (which is FixATan2(1,1)) is the approximation to π/4
  28733. used for argument reduction. Thus, FracCos and FracSin are nearly periodic, but with
  28734. period 2*P instead of 2*π, where P=3.1416015625 and π, of course, is 3.14159265....
  28735.  
  28736. æKY FracCos
  28737. æFc FixMath.h
  28738. æT Function
  28739. æTN A847
  28740. æD pascal Fract FracCos(Fixed x)
  28741.     = 0xA847; 
  28742. æDT Fract myVariable = FracCos((Fixed) x);
  28743. æRI IV-64
  28744. æC 
  28745. FracCos and FracSin return the cosine and sine of their radian arguments, respectively.
  28746. The hexadecimal value 0.C910 (which is FixATan2(1,1)) is the approximation to π/4
  28747. used for argument reduction. Thus, FracCos and FracSin are nearly periodic, but with
  28748. period 2*P instead of 2*π, where P=3.1416015625 and π, of course, is 3.14159265....
  28749.  
  28750.  
  28751. æKY Float.h
  28752. æFc Float.h
  28753. æD                            Synopsis
  28754.  
  28755. #define DBL_DIG          15
  28756. #define DBL_EPSILO       (scalb(-52,1.0))
  28757. #define DBL_MANT_DIG     53
  28758. #define DBL_MAX          (nextdouble(inf(),0.0))
  28759. #define DBL_MAX_10_EXP   308
  28760. #define DBL_MAX_EXP      1024
  28761. #define DBL_MI           (scalb(DBL_MIN_EXP-1,1.0))
  28762. #define DBL_MIN_10_EXP   (-307)
  28763. #define DBL_MIN_EXP      (-1021)
  28764. #define FLT_DIG          7
  28765. #define FLT_EPSILO       (scalb(-23,1.0))
  28766. #define FLT_MANT_DIG     24
  28767. #define FLT_MAX          (nextfloat(inf(),0.0))
  28768. #define FLT_MAX_10_EXP   38
  28769. #define FLT_MAX_EXP      128
  28770. #define FLT_MI           (scalb(FLT_MIN_EXP-1,1.0))
  28771. #define FLT_MIN_10_EXP   (-37)
  28772. #define FLT_MIN_EXP      (-125)
  28773. #define FLT_RADIX        2
  28774. #define FLT_ROUNDS       ((getround()+1) % 4)
  28775. #define LDBL_DIG         19
  28776. #define LDBL_EPSILO      (scalb(-63,1.0))
  28777. #define LDBL_MANT_DIG    64
  28778. #define LDBL_MAX         (nextextended(inf(),0.0))
  28779. #define LDBL_MAX_10_EXP  4932
  28780. #define LDBL_MAX_EXP     16384
  28781. #define LDBL_MI          (scalb(LDBL_MIN_EXP-1,1.0))
  28782. #define LDBL_MIN_10_EXP  (-4931)
  28783. #define LDBL_MIN_EXP     (-16382)
  28784.  
  28785.  
  28786. æC                           Description
  28787.  
  28788. The header <Float.h> specifies the characteristics of floating 
  28789. types float, double, and long double. The functions scalb, 
  28790. nextfloat, nextround, and nextextended, used in the macros 
  28791. above, are declared in <SANE.h>.
  28792.  
  28793. See also
  28794. Apple Numerics Manual, 2nd edition
  28795.  
  28796.  
  28797. æKY Folders.h
  28798. æKL FindFolder
  28799.  
  28800. kAppleMenuFolderType
  28801. kControlPanelFolderType
  28802. kCreateFolder
  28803. kDesktopFolderType
  28804. kDontCreateFolder
  28805. kExtensionFolderType
  28806. kOnSystemDisk
  28807. kPreferencesFolderType
  28808. kSpoolFolderType
  28809. kStartupFolderType
  28810. kSystemFolderType
  28811. kTemporaryFolderType
  28812. kTrashFolderType
  28813. kWhereToEmptyTrashFolderType
  28814.  
  28815. æKY kOnSystemDisk
  28816. æFc Folders.h
  28817. æT #define
  28818. æD #define kOnSystemDisk 0x8000
  28819. æC 
  28820.  
  28821. æKY kCreateFolder
  28822. æFc Folders.h
  28823. æT #define
  28824. æD #define kCreateFolder TRUE
  28825. æC 
  28826.  
  28827. æKY kDontCreateFolder
  28828. æFc Folders.h
  28829. æT #define
  28830. æD #define kDontCreateFolder FALSE
  28831. æC 
  28832.  
  28833. æKY kSystemFolderType
  28834. æFc Folders.h
  28835. æT #define
  28836. æD #define kSystemFolderType 'macs' /*the system folder*/
  28837. æC 
  28838.  
  28839. æKY kDesktopFolderType
  28840. æFc Folders.h
  28841. æT #define
  28842. æD #define kDesktopFolderType 'desk' /*the desktop folder; objects in this folder show on the desk top.*/
  28843. æC 
  28844.  
  28845. æKY kTrashFolderType
  28846. æFc Folders.h
  28847. æT #define
  28848. æD #define kTrashFolderType 'trsh' /*the trash folder; objects in this folder show up in the trash*/
  28849. æC 
  28850.  
  28851. æKY kWhereToEmptyTrashFolderType
  28852. æFc Folders.h
  28853. æT #define
  28854. æD #define kWhereToEmptyTrashFolderType 'empt' /*the "empty trash" folder; Finder starts empty from here down*/
  28855. æC 
  28856.  
  28857. æKY kSpoolFolderType
  28858. æFc Folders.h
  28859. æT #define
  28860. æD #define kSpoolFolderType 'spoo' /*spool files go here (from the print drivers to the despooler*/
  28861. æC 
  28862.  
  28863. æKY kStartupFolderType
  28864. æFc Folders.h
  28865. æT #define
  28866. æD #define kStartupFolderType 'strt' /*Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here*/
  28867. æC 
  28868.  
  28869. æKY kAppleMenuFolderType
  28870. æFc Folders.h
  28871. æT #define
  28872. æD #define kAppleMenuFolderType 'amnu' /*Finder objects to put into the Apple menu go here*/
  28873. æC 
  28874.  
  28875. æKY kControlPanelFolderType
  28876. æFc Folders.h
  28877. æT #define
  28878. æD #define kControlPanelFolderType 'ctrl' /*Control Panels go here (may contain INITs)*/
  28879. æC 
  28880.  
  28881. æKY kExtensionFolderType
  28882. æFc Folders.h
  28883. æT #define
  28884. æD #define kExtensionFolderType 'extn' /*Finder extensions go here*/
  28885. æC 
  28886.  
  28887. æKY kPreferencesFolderType
  28888. æFc Folders.h
  28889. æT #define
  28890. æD #define kPreferencesFolderType 'pref' /*preferences for applications go here*/
  28891. æC 
  28892.  
  28893. æKY kTemporaryFolderType
  28894. æFc Folders.h
  28895. æT #define
  28896. æD #define kTemporaryFolderType 'temp' /*temporary files go here (deleted periodically, but don't rely on it.)*/
  28897. æC 
  28898.  
  28899. æKY FindFolder
  28900. æFc Folders.h
  28901. æT Function
  28902. æD pascal OSErr FindFolder(short vRefNum,OSType folderType,Boolean  createFolder,
  28903.     short *foundVRefNum,long *foundDirID)
  28904.     = {0x7000,0xA823}; 
  28905. æDT OSErr myVariable = FindFolder((short) vRefNum,(OSType) folderType,(Boolean)  createFolder,(
  28906.     short) * foundVRefNum,(long *) foundDirID);
  28907. æC 
  28908. You can call the FindFolder function to get the path information so that you can
  28909. access special folders. You pass FindFolder a target volume and a constant that
  28910. tells it which special folder you are interested in. FindFolder returns a volume
  28911. reference number and a directory ID. If the specified folder does not exist,
  28912. FindFolder can create it and return the new directory ID.
  28913.  
  28914. The Finder identifies the folder types and their names in a resource of type 
  28915. 'fld#'. Table 8-2 lists the folder types in version 7.0, their resource types,
  28916. and the constants that represent them.
  28917.  
  28918. Table 8-2.  Special folders
  28919.  
  28920. Folder                Type    Constant
  28921.  
  28922. System Folder         'macs'  kSystemFolderType
  28923. Extensions folder     'extn'  kExtensionFolderType
  28924. Preferences folder    'pref'  kPreferencesFolderType
  28925. Apple Menu Folder     'amnu'  kAppleMenuFolderType
  28926. Startup Folder        'strt'  kStartupFolderType
  28927. Print Monitor Folder  'spoo'  kSpoolFolderType
  28928. Temporary folder      'temp'  kTemporaryFolderType
  28929. Desktop folder        'desk'  kDesktopFolderType
  28930. Single-user
  28931.     trash folder      'trsh'  kTrashFolderType
  28932. Shared trash folder   'empt'  kSharedTrashFolderType
  28933.  
  28934. In calls to FindFolder, you can use these three constants:
  28935.  
  28936. CONST
  28937. kOnSystemDisk = $8000;
  28938. kCreateFolder = TRUE;
  28939. kDontCreateFolder = FALSE;
  28940.  
  28941. Call the FindFolder function to get a volume and directory ID for a special
  28942. folder.
  28943.  
  28944. The FindFolder function returns the volume reference number and directory ID of
  28945. a specified special folder on a specified volume. You specify a volume reference
  28946. number (or the constant kOnSystemDisk for the boot disk) in the vRefNum
  28947. parameter. You specify the folder type in the folderType parameter, using one of
  28948. the constants listed in Table 8-2. The createFolder parameter tells FindFolder
  28949. whether or not to create a folder if it does not already exist. FindFolder puts
  28950. the results in foundVRefNum and foundDirID.
  28951.  
  28952. Result codes
  28953. fnfErr  -43     Type not found in 'fld# resource;
  28954.                 Folder not found and createFolder flag false
  28955. dupFNErr  -48   File found instead of folder
  28956.  
  28957.  
  28958. æKY Fonts.h
  28959. æKL FMSwapFont
  28960. FontMetrics
  28961. getfnum
  28962. GetFNum
  28963. getfontname
  28964. GetFontName
  28965. InitFonts
  28966. RealFont
  28967. SetFontLock
  28968. SetFractEnable
  28969. SetFScaleDisable
  28970.  
  28971. appleMark
  28972. applFont
  28973. AsscEntry
  28974. athens
  28975. cairo
  28976. checkMark
  28977. commandMark
  28978. courier
  28979. diamondMark
  28980. FamRec
  28981. fixedFont
  28982. FMetricRec
  28983. FMInput
  28984. FMOutPtr
  28985. FMOutput
  28986. FontAssoc
  28987. FontRec
  28988. fontWid
  28989. fxdFntH
  28990. fxdFntHW
  28991. fxdFntW
  28992. geneva
  28993. helvetica
  28994. KernEntry
  28995. KernPair
  28996. KernTable
  28997. london
  28998. losAngeles
  28999. mobile
  29000. monaco
  29001. NameTable
  29002. newYork
  29003. propFont
  29004. prpFntH
  29005. prpFntHW
  29006. prpFntW
  29007. sanFran
  29008. StyleTable
  29009. symbol
  29010. systemFont
  29011. times
  29012. toronto
  29013. venice
  29014. WidEntry
  29015. WidTable
  29016. WidthTable
  29017.  
  29018. æKY systemFont
  29019. æFc Fonts.h
  29020. æT #define
  29021. æD #define systemFont 0
  29022. æC 
  29023. _______________________________________________________________________________
  29024.  
  29025. »FONT NUMBERS
  29026. _______________________________________________________________________________
  29027.  
  29028. Note:  The information on Font Numbers described in the following
  29029.        paragraphs was originally documented in Inside Macintosh, Volume I.
  29030.  
  29031. The Font Manager includes the following font numbers for identifying system-defined
  29032. fonts:
  29033.  
  29034. CONST  systemFont  = 0;    {system font}
  29035.        applFont    = 1;    {application font}
  29036.        newYork     = 2;
  29037.        geneva      = 3;
  29038.        monaco      = 4;
  29039.        venice      = 5;
  29040.        london      = 6;
  29041.        athens      = 7;
  29042.        sanFran     = 8;
  29043.        toronto     = 9;
  29044.        cairo       = 11;
  29045.        losAngeles  = 12;
  29046.        times       = 20;
  29047.        helvetica   = 21;
  29048.        courier     = 22;
  29049.        symbol      = 23;
  29050.        taliesin    = 24;
  29051.  
  29052. The system font is so called because it’s the font used by the system (for drawing
  29053. menu titles and commands in menus, for example). The name of the system font is
  29054. Chicago. The size of text drawn by the system in this font is fixed at 12 points
  29055. (called the system font size).
  29056.  
  29057. The application font is the font your application will use unless you specify otherwise.
  29058. Unlike the system font, the application font isn’t a separate font, but is essentially
  29059. a reference to another font—Geneva, by default. (The application font number is
  29060. determined by a value that you can set in parameter RAM; see the Operating System
  29061. Utilities chapter for more information.)
  29062.  
  29063. Assembly-language note:  You can get the application font number
  29064.                          from the global variable ApFontID.
  29065.  
  29066. æKY applFont
  29067. æFc Fonts.h
  29068. æT #define
  29069. æD #define applFont 1
  29070. æC 
  29071.  
  29072. æKY newYork
  29073. æFc Fonts.h
  29074. æT #define
  29075. æD #define newYork 2
  29076. æC 
  29077.  
  29078. æKY geneva
  29079. æFc Fonts.h
  29080. æT #define
  29081. æD #define geneva 3
  29082. æC 
  29083.  
  29084. æKY monaco
  29085. æFc Fonts.h
  29086. æT #define
  29087. æD #define monaco 4
  29088. æC 
  29089.  
  29090. æKY venice
  29091. æFc Fonts.h
  29092. æT #define
  29093. æD #define venice 5
  29094. æC 
  29095.  
  29096. æKY london
  29097. æFc Fonts.h
  29098. æT #define
  29099. æD #define london 6
  29100. æC 
  29101.  
  29102. æKY athens
  29103. æFc Fonts.h
  29104. æT #define
  29105. æD #define athens 7
  29106. æC 
  29107.  
  29108. æKY sanFran
  29109. æFc Fonts.h
  29110. æT #define
  29111. æD #define sanFran 8
  29112. æC 
  29113.  
  29114. æKY toronto
  29115. æFc Fonts.h
  29116. æT #define
  29117. æD #define toronto 9
  29118. æC 
  29119.  
  29120. æKY cairo
  29121. æFc Fonts.h
  29122. æT #define
  29123. æD #define cairo 11
  29124. æC 
  29125.  
  29126. æKY losAngeles
  29127. æFc Fonts.h
  29128. æT #define
  29129. æD #define losAngeles 12
  29130. æC 
  29131.  
  29132. æKY times
  29133. æFc Fonts.h
  29134. æT #define
  29135. æD #define times 20
  29136. æC 
  29137.  
  29138. æKY helvetica
  29139. æFc Fonts.h
  29140. æT #define
  29141. æD #define helvetica 21
  29142. æC 
  29143.  
  29144. æKY courier
  29145. æFc Fonts.h
  29146. æT #define
  29147. æD #define courier 22
  29148. æC 
  29149.  
  29150. æKY symbol
  29151. æFc Fonts.h
  29152. æT #define
  29153. æD #define symbol 23
  29154. æC 
  29155.  
  29156. æKY mobile
  29157. æFc Fonts.h
  29158. æT #define
  29159. æD #define mobile 24
  29160. æC 
  29161.  
  29162. æKY commandMark
  29163. æFc Fonts.h
  29164. æT #define
  29165. æD #define commandMark 17
  29166. æC 
  29167. _______________________________________________________________________________
  29168. »CHARACTERS IN A FONT
  29169. _______________________________________________________________________________
  29170.  
  29171. Note:  The information on the Characters In A Font described in the following
  29172.        paragraphs was originally documented in Inside Macintosh, Volume I.
  29173.  
  29174. A font can consist of up to 255 distinct characters; not all characters need to be
  29175. defined in a single font. Figure 20 shows the standard printing characters on the
  29176. Macintosh and their ASCII codes (for example, the ASCII code for “A” is 41 hexadecimal,
  29177. or 65 decimal).
  29178.  
  29179. Note:  Codes $00 through $1F and code $7F are normally nonprinting
  29180.        characters (see the Toolbox Event Manager chapter for details).
  29181.  
  29182. The special characters in the system font with codes $11 through $14 can’t normally
  29183. be typed from the keyboard or keypad. The Font Manager defines constants for these
  29184. characters:
  29185.  
  29186. CONST  commandMark  = $11;    {Command key symbol}
  29187.        checkMark    = $12;    {check mark}
  29188.        diamondMark  = $13;    {diamond symbol}
  29189.        appleMark    = $14;    {apple symbol}
  29190.  
  29191. In addition to its maximum of 255 characters, every font contains a missing symbol
  29192. that’s drawn in case of a request to draw a character that’s missing from the font.
  29193.  
  29194. •••Refer to Figure 20.•••
  29195.  
  29196. Figure 20–Font Characters
  29197.  
  29198. æKY checkMark
  29199. æFc Fonts.h
  29200. æT #define
  29201. æD #define checkMark 18
  29202. æC 
  29203.  
  29204. æKY diamondMark
  29205. æFc Fonts.h
  29206. æT #define
  29207. æD #define diamondMark 19
  29208. æC 
  29209.  
  29210. æKY appleMark
  29211. æFc Fonts.h
  29212. æT #define
  29213. æD #define appleMark 20
  29214. æC 
  29215.  
  29216. æKY propFont
  29217. æFc Fonts.h
  29218. æT #define
  29219. æD #define propFont 36864
  29220. æC 
  29221.  
  29222. æKY prpFntH
  29223. æFc Fonts.h
  29224. æT #define
  29225. æD #define prpFntH 36865
  29226. æC 
  29227.  
  29228. æKY prpFntW
  29229. æFc Fonts.h
  29230. æT #define
  29231. æD #define prpFntW 36866
  29232. æC 
  29233.  
  29234. æKY prpFntHW
  29235. æFc Fonts.h
  29236. æT #define
  29237. æD #define prpFntHW 36867
  29238. æC 
  29239.  
  29240. æKY fixedFont
  29241. æFc Fonts.h
  29242. æT #define
  29243. æD #define fixedFont 45056
  29244. æC 
  29245.  
  29246. æKY fxdFntH
  29247. æFc Fonts.h
  29248. æT #define
  29249. æD #define fxdFntH 45057
  29250. æC 
  29251.  
  29252. æKY fxdFntW
  29253. æFc Fonts.h
  29254. æT #define
  29255. æD #define fxdFntW 45058
  29256. æC 
  29257.  
  29258. æKY fxdFntHW
  29259. æFc Fonts.h
  29260. æT #define
  29261. æD #define fxdFntHW 45059
  29262. æC 
  29263.  
  29264. æKY fontWid
  29265. æFc Fonts.h
  29266. æT #define
  29267. æD #define fontWid 44208
  29268. æC 
  29269.  
  29270. æKY FMInput
  29271. æFc Fonts.h
  29272. æT struct
  29273. æD struct FMInput {
  29274.     short family;
  29275.     short size;
  29276.     Style face;
  29277.     Boolean needBits;
  29278.     short device;
  29279.     Point numer;
  29280.     Point denom;
  29281. };
  29282.  
  29283. typedef struct FMInput FMInput;
  29284. æC 
  29285. ______________________________________________________________________________
  29286.  
  29287. »COMMUNICATION BETWEEN QUICKDRAW AND THE FONT MANAGER
  29288. _______________________________________________________________________________
  29289.  
  29290. This section describes the data structures that allow QuickDraw and the Font Manager
  29291. to exchange information. It also discusses the communication that may occur between
  29292. the Font Manager and the driver of the device on which the characters are being drawn
  29293. or printed. You can skip this section if you want to change fonts, character style,
  29294. and font sizes by calling QuickDraw and aren’t interested in the lower-level data
  29295. structures and routines of the Font Manager. To understand this section fully, you’ll
  29296. have to be familiar with device drivers and the Device Manager.
  29297.  
  29298. Whenever you call a QuickDraw routine that does anything with text, QuickDraw requests
  29299. information from the Font Manager about the characters. The Font Manager performs any
  29300. necessary calculations and returns the requested information to QuickDraw. As illustrated
  29301. in Figure 21, this information exchange occurs via two data structures, a font input
  29302. record (type FMInput) and a font output record (type FMOutput).
  29303.  
  29304. First, QuickDraw passes the Font Manager a font input record:
  29305.  
  29306. TYPE FMInput = PACKED RECORD
  29307.                  family:    INTEGER;  {font number}
  29308.                  size:      INTEGER;  {font size}
  29309.                  face:      Style;    {character style}
  29310.                  needBits:  BOOLEAN;  {TRUE if drawing}
  29311.                  device:    INTEGER;  {device-specific information}
  29312.                  numer:     Point;    {numerators of scaling factors}
  29313.                  denom:     Point     {denominators of scaling factors}
  29314.                END;
  29315.  
  29316. The first three fields contain the font number, size, and character style that QuickDraw
  29317. wants to use.
  29318.  
  29319. The needBits field indicates whether the characters actually will be drawn or not. If
  29320. the characters are being drawn, all of the information describing the font, including
  29321. the bit image comprising the characters, will be read into memory. If the characters
  29322. aren’t being drawn and there’s a resource consisting of only the character widths and
  29323. general font information, that resource will be read instead.
  29324.  
  29325. The high-order byte of the device field contains a device driver reference number.
  29326. From the driver reference number, the Font Manager can determine the optimum stylistic
  29327. variations on the font to produce the highest-quality printing or drawing available
  29328. on a device (as explained below). The low-order byte of the device field is ignored
  29329. by the Font Manager but may contain information used by the device driver.
  29330.  
  29331. •••Refer to Figure 21.•••
  29332.  
  29333. Figure 21–Communication About Fonts
  29334.  
  29335. The numer and denom fields contain the scaling factors to be used; numer.v divided by
  29336. denom.v gives the vertical scaling, and numer.h divided by denom.h gives the horizontal
  29337. scaling.
  29338.  
  29339. The Font Manager takes the font input record and asks the Resource Manager for the
  29340. font. If the requested size isn’t available, the Font Manager scales another size to
  29341. match (as described under “Font Scaling”).
  29342.  
  29343. Then the Font Manager gets the font characterization table via the device field. If
  29344. the high-order byte of the device field is 0, the Font Manager gets the screen’s font
  29345. characterization table (which is stored in the Font Manager). If the high-order byte
  29346. of the device field is nonzero, the Font Manager calls the status routine of the
  29347. device driver having that reference number, and the status routine returns a font
  29348. characterization table. The status routine may use the value of the low-order byte of
  29349. the device field to determine the font characterization table it should return.
  29350.  
  29351. Note:  If you want to make your own calls to the device driver’s Status
  29352.        function, the reference number must be the driver reference number
  29353.        from the font input record’s device field, csCode must be 8, csParam
  29354.        must be a pointer to where the device driver should put the font
  29355.        characterization table, and csParam+4 must be an integer containing
  29356.        the value of the font input record’s device field.
  29357.  
  29358. Figure 22 shows the structure of a font characterization table and, on the right, the
  29359. values it contains for the Macintosh screen.
  29360.  
  29361. •••Refer to Figure 22.•••
  29362.  
  29363. Figure 22–Font Characterization Table
  29364.  
  29365. The first two words of the font characterization table contain the approximate number
  29366. of dots per inch on the device. These values are only used for scaling between devices;
  29367. they don’t necessarily correspond to a device’s actual resolution.
  29368.  
  29369. The remainder of the table consists of three-byte triplets providing information
  29370. about the different stylistic variations. For all but the triplet defining the underline
  29371. characteristics:
  29372.  
  29373.   •  The first byte in the triplet indicates which byte beyond the bold
  29374.      field of the font output record (see below) is affected by the triplet.
  29375.   •  The second byte contains the amount to be stored in the affected field.
  29376.   •  The third byte indicates the amount by which the extra field of the
  29377.      font output record is to be incremented (starting from 0).
  29378.  
  29379. The triplet defining the underline characteristics indicates the amount by which the
  29380. font output record’s ulOffset, ulShadow, and ulThick fields
  29381. (respectively) should be incremented.
  29382.  
  29383. æKY FMOutput
  29384. FMOutPtr
  29385. æFc Fonts.h
  29386. æT struct
  29387. æD struct FMOutput {
  29388.     short errNum;
  29389.     Handle fontHandle;
  29390.     unsigned char boldPixels;
  29391.     unsigned char italicPixels;
  29392.     unsigned char ulOffset;
  29393.     unsigned char ulShadow;
  29394.     unsigned char ulThick;
  29395.     unsigned char shadowPixels;
  29396.     char extra;
  29397.     unsigned char ascent;
  29398.     unsigned char descent;
  29399.     unsigned char widMax;
  29400.     char leading;
  29401.     char unused;
  29402.     Point numer;
  29403.     Point denom;
  29404. };
  29405.  
  29406. typedef struct FMOutput FMOutput;
  29407. typedef FMOutput *FMOutPtr;
  29408.  
  29409. æC 
  29410.  
  29411. Based on the information in the font characterization table, the Font Manager determines
  29412. the optimum ascent, descent, and leading, so that the highest-quality printing or
  29413. drawing available will be produced. It then stores this information in a font output
  29414. record:
  29415.  
  29416. TYPE FMOutput = PACKED RECORD
  29417.                   errNum:      INTEGER;     {not used}
  29418.                   fontHandle:  Handle;      {handle to font record}
  29419.                   bold:        Byte;        {bold factor}
  29420.                   italic:      Byte;        {italic factor}
  29421.                   ulOffset:    Byte;        {underline offset}
  29422.                   ulShadow:    Byte;        {underline shadow}
  29423.                   ulThick:     Byte;        {underline thickness}
  29424.                   shadow:      Byte;        {shadow factor}
  29425.                   extra:       SignedByte;  {width of style}
  29426.                   ascent:      Byte;        {ascent}
  29427.                   descent:     Byte;        {descent}
  29428.                   widMax:      Byte;        {maximum character width}
  29429.                   leading:     SignedByte;  {leading}
  29430.                   unused:      Byte;        {not used}
  29431.                   numer:       Point;       {numerators of scaling factors}
  29432.                   denom:       Point        {denominators of scaling factors}
  29433.                 END;
  29434.  
  29435. ErrNum is reserved for future use, and is set to 0. FontHandle is a handle to the
  29436. font record of the font, as described in the next section. Bold, italic, ulOffset,
  29437. ulShadow, ulThick, and shadow are all fields that modify the way stylistic variations
  29438. are done; their values are taken from the font characterization table, and are used
  29439. by QuickDraw. (You’ll need to experiment with these values if you want to determine
  29440. exactly how they’re used.) Extra indicates the number of pixels that each character
  29441. has been widened by stylistic variation. For example, using the screen values shown
  29442. in Figure 22, the extra field for bold shadowed characters would be 3. Ascent, descent,
  29443. widMax, and leading are the same as the fields of the FontInfo record returned by the
  29444. QuickDraw procedure GetFontInfo. Numer and denom contain the scaling factors.
  29445.  
  29446. Just before returning this record to QuickDraw, the Font Manager calls the device
  29447. driver’s control routine to allow the driver to make any final modifications to the
  29448. record. Finally, the font information is returned to QuickDraw via a pointer to the
  29449. record, defined as follows:
  29450.  
  29451. TYPE FMOutPtr = ^FMOutput;
  29452.  
  29453. Note:  If you want to make your own calls to the device driver’s Control
  29454.        function, the reference number must be the driver reference number
  29455.        from the font input record’s device field, csCode must be 8, csParam
  29456.        must be a pointer to the font output record, and csParam+4 must be
  29457.        the value of the font input record’s device field.
  29458.  
  29459. æKY FontRec
  29460. æFc Fonts.h
  29461. æT struct
  29462. æD struct FontRec {
  29463.     short fontType; /*font type*/
  29464.     short firstChar; /*ASCII code of first character*/
  29465.     short lastChar; /*ASCII code of last character*/
  29466.     short widMax; /*maximum character width*/
  29467.     short kernMax; /*negative of maximum character kern*/
  29468.     short nDescent; /*negative of descent*/
  29469.     short fRectWidth; /*width of font rectangle*/
  29470.     short fRectHeight; /*height of font rectangle*/
  29471.     short owTLoc; /*offset to offset/width table*/
  29472.     short ascent; /*ascent*/
  29473.     short descent; /*descent*/
  29474.     short leading; /*leading*/
  29475.     short rowWords; /*row width of bit image / 2 */
  29476. };
  29477.  
  29478. typedef struct FontRec FontRec;
  29479. æC 
  29480.  
  29481. »Font Records
  29482.  
  29483. The information describing a font is contained in a data structure called a font
  29484. record, which contains the following:
  29485.  
  29486.   •  the font type (fixed-width or proportional)
  29487.   •  the ASCII code of the first character and the last character in the font
  29488.   •  the maximum character width and maximum amount any character kerns
  29489.   •  the font height, ascent, descent, and leading
  29490.   •  the bit image of the font
  29491.   •  a location table, which is an array of words specifying the location
  29492.      of each character image within the bit image
  29493.   •  an offset/width table, which is an array of words specifying the
  29494.      character offset and character width for each character in the font
  29495.  
  29496. For every character, the location table contains a word that specifies the bit offset
  29497. to the location of that character’s image in the bit image. The entry for a character
  29498. missing from the font contains the same value as the entry for the next character.
  29499. The last word of the table contains the offset to one bit beyond the end of the bit
  29500. image (that is, beyond the character image for the missing symbol). The image width
  29501. of each character is determined from the location table by subtracting the bit offset
  29502. to that character from the bit offset to the next character in the table.
  29503.  
  29504. There’s also one word in the offset/width table for every character:  The high-order
  29505. byte specifies the character offset and the low order byte specifies the character
  29506. width. Missing characters are flagged in this table by a word value of –1. The last
  29507. word is also –1, indicating the end of the table.
  29508.  
  29509. Note:  The 64K ROM version of the Resource Manager limits the total space
  29510.        occupied by the bit image, location table, offset/width table, and
  29511.        character-width and image-height tables to 32K bytes. For this reason,
  29512.        the practical limit on the font size of a full font is about 40 points.
  29513.  
  29514. Figure 9 illustrates a sample location table and offset/width table corresponding to
  29515. the bit image in Figure 8 above.
  29516.  
  29517. A font record is referred to by a handle that you can get by calling the FMSwapFont
  29518. function or the Resource Manager function GetResource. The data type for a font
  29519. record is as follows:
  29520.  
  29521. TYPE FontRec = RECORD
  29522.                  fontType:     INTEGER;    {font type}
  29523.                  firstChar:    INTEGER;    {ASCII code of first character}
  29524.                  lastChar:     INTEGER;    {ASCII code of last character}
  29525.                  widMax:       INTEGER;    {maximum character width}
  29526.                  kernMax:      INTEGER;    {negative of maximum character kern}
  29527.                  nDescent:     INTEGER;    {negative of descent}
  29528.                  fRectWidth:   INTEGER;    {width of font rectangle}
  29529.                  fRectHeight:  INTEGER;    {height of font rectangle}
  29530.                  owTLoc:       INTEGER;    {offset to offset/width table}
  29531.                  ascent:       INTEGER;    {ascent}
  29532.                  descent:      INTEGER;    {descent}
  29533.                  leading:      INTEGER;    {leading}
  29534.                  rowWords:     INTEGER;    {row width of bit image / 2}
  29535.                { bitImage:     ARRAY[1..rowWords,1..fRectHeight] OF INTEGER; }
  29536.                                            {bit image}
  29537.                { locTable:     ARRAY[firstChar..lastChar+2] OF INTEGER; }
  29538.                                            {location table}
  29539.                { owTable:      ARRAY[firstChar..lastChar+2] OF INTEGER; }
  29540.                                            {offset/width table}
  29541.                END;
  29542.  
  29543. Note:  The variable-length arrays appear as comments because they’re
  29544.        not valid Pascal syntax; they’re used only as conceptual aids.
  29545.  
  29546. •••Refer to Figure 9.•••
  29547.  
  29548. Figure 9–Sample Location Table and Offset/Width Table
  29549.  
  29550. The fontType field must contain one of the following predefined constants:
  29551.  
  29552. CONST  propFont   = $9000;    {proportional font}
  29553.        fixedFont  = $B000;    {fixed-width font}
  29554.  
  29555. The values in the widMax, kernMax, nDescent, fRectWidth, fRectHeight, ascent, descent,
  29556. and leading fields all specify a number of pixels.
  29557.  
  29558. KernMax indicates the largest number of pixels any character kerns, that is, the
  29559. distance from the character origin to the left edge of the font rectangle. It should
  29560. always be 0 or negative, since the kerned pixels are to the left of the character
  29561. origin. NDescent is the negative of the descent (the distance from the character
  29562. origin to the bottom of the font rectangle).
  29563.  
  29564. The owTLoc field contains a word offset from itself to the offset/width table; it’s
  29565. equivalent to
  29566.  
  29567.   4 + (rowWords * fRectHeight) + (lastChar–firstChar+3) + 1
  29568.  
  29569. Warning:  Remember, the offset and row width in a font record are
  29570.           given in words, not bytes.
  29571.  
  29572. Assembly-language note:  The global variable ROMFont0 contains a handle
  29573.                          to the font record for the system font.
  29574.  
  29575. Every size of a font is stored as a separate resource.  The resource type for a font
  29576. is 'FONT'.  The resource data for a font is simply a font record:
  29577.  
  29578.   Number of bytes    Contents
  29579.  
  29580.       2 bytes        FontType field of font record
  29581.       2 bytes        FirstChar field of font record
  29582.       2 bytes        LastChar field of font record
  29583.       2 bytes        WidMax field of font record
  29584.       2 bytes        KernMax field of font record
  29585.       2 bytes        NDescent field of font record
  29586.       2 bytes        FRectWidth field of font record
  29587.       2 bytes        FRectHeight field of font record
  29588.       2 bytes        OWTLoc field of font record
  29589.       2 bytes        Ascent field of font record
  29590.       2 bytes        Descent field of font record
  29591.       2 bytes        Leading field of font record
  29592.       2 bytes        RowWords field of font record
  29593.       n bytes        Bit image of font
  29594.                          n = 2 * rowWords * fRectHeight
  29595.       m bytes        Location table of font
  29596.                          m = 2 * (lastChar–firstChar+3)
  29597.       m bytes        Offset/width table of font
  29598.                          m = 2 * (lastChar–firstChar+3)
  29599.  
  29600. As shown in Figure 10, the resource ID of a font has the following format:  Bits 0-6
  29601. are the font size, bits 7-14 are the font number, and bit 15 is 0. Thus the resource
  29602. ID corresponding to a given font number and size is
  29603.  
  29604.   (128 * font number) + font size
  29605.  
  29606. •••Refer to Technical Note #245:•••
  29607.  
  29608. Since 0 is not a valid font size, the resource ID having 0 in the size field is used
  29609. to provide only the name of the font:  The name of the resource is the font name. For
  29610. example, for a font named Griffin and numbered 200, the resource naming the font
  29611. would have a resource ID of 25600 and the resource name
  29612. 'Griffin'. Size 10 of that font would be stored in a resource numbered 25610.
  29613.  
  29614. •••Refer to Figure 10.•••
  29615.  
  29616. Figure 10–Resource ID for a Font
  29617.  
  29618. The resource type 'FRSV' is reserved by the Font Manager; it identifies fonts used by
  29619. the system. Fonts whose resource IDs are contained in a 'FRSV' resource 1 will not be
  29620. removed from the system resource file by the Font/DA Mover. The format of a 'FRSV'
  29621. resource is as follows:
  29622.  
  29623.   Number of bytes    Contents
  29624.  
  29625.       2 bytes        Number of font resource IDs
  29626.       n * 2 bytes    n font resource IDs
  29627.  
  29628. æKY FMetricRec
  29629. æFc Fonts.h
  29630. æT struct
  29631. æD struct FMetricRec {
  29632.     Fixed ascent; /*base line to top*/
  29633.     Fixed descent; /*base line to bottom*/
  29634.     Fixed leading; /*leading between lines*/
  29635.     Fixed widMax; /*maximum character width*/
  29636.     Handle wTabHandle; /*handle to font width table*/
  29637. };
  29638.  
  29639. typedef struct FMetricRec FMetricRec;
  29640. æC 
  29641.  
  29642. æKY WidEntry
  29643. æFc Fonts.h
  29644. æT struct
  29645. æD struct WidEntry {
  29646.     short widStyle; /*style entry applies to*/
  29647. };
  29648.  
  29649. typedef struct WidEntry WidEntry;
  29650. æC 
  29651.  
  29652. æKY WidTable
  29653. æFc Fonts.h
  29654. æT struct
  29655. æD struct WidTable {
  29656.     short numWidths; /*number of entries - 1*/
  29657. };
  29658.  
  29659. typedef struct WidTable WidTable;
  29660. æC 
  29661.  
  29662. æKY AsscEntry
  29663. æFc Fonts.h
  29664. æT struct
  29665. æD struct AsscEntry {
  29666.     short fontSize;
  29667.     short fontStyle;
  29668.     short fontID; /*font resource ID*/
  29669. };
  29670.  
  29671. typedef struct AsscEntry AsscEntry;
  29672. æC 
  29673.  
  29674. æKY FontAssoc
  29675. æFc Fonts.h
  29676. æT struct
  29677. æD struct FontAssoc {
  29678.     short numAssoc; /*number of entries - 1*/
  29679. };
  29680.  
  29681. typedef struct FontAssoc FontAssoc;
  29682. æC 
  29683.  
  29684. æKY StyleTable
  29685. æFc Fonts.h
  29686. æT struct
  29687. æD struct StyleTable {
  29688.     short fontClass;
  29689.     long offset;
  29690.     long reserved;
  29691.     char indexes[48];
  29692. };
  29693.  
  29694. typedef struct StyleTable StyleTable;
  29695. æC 
  29696.  
  29697. æKY NameTable
  29698. æFc Fonts.h
  29699. æT struct
  29700. æD struct NameTable {
  29701.     short stringCount;
  29702.     Str255 baseFontName;
  29703. };
  29704.  
  29705. typedef struct NameTable NameTable;
  29706. æC 
  29707.  
  29708. æKY KernPair
  29709. æFc Fonts.h
  29710. æT struct
  29711. æD struct KernPair {
  29712.     char kernFirst; /*1st character of kerned pair*/
  29713.     char kernSecond; /*2nd character of kerned pair*/
  29714.     short kernWidth; /*kerning in 1pt fixed format*/
  29715. };
  29716.  
  29717. typedef struct KernPair KernPair;
  29718. æC 
  29719.  
  29720. æKY KernEntry
  29721. æFc Fonts.h
  29722. æT struct
  29723. æD struct KernEntry {
  29724.     short kernLength; /*length of this entry*/
  29725.     short kernStyle; /*style the entry applies to*/
  29726. };
  29727.  
  29728. typedef struct KernEntry KernEntry;
  29729. æC 
  29730.  
  29731. æKY KernTable
  29732. æFc Fonts.h
  29733. æT struct
  29734. æD struct KernTable {
  29735.     short numKerns; /*number of kerning entries*/
  29736. };
  29737.  
  29738. typedef struct KernTable KernTable;
  29739. æC 
  29740.  
  29741. æKY WidthTable
  29742. æFc Fonts.h
  29743. æT struct
  29744. æD struct WidthTable {
  29745.     Fixed tabData[256]; /*character widths*/
  29746.     Handle tabFont; /*font record used to build table*/
  29747.     long sExtra; /*space extra used for table*/
  29748.     long style; /*extra due to style*/
  29749.     short fID; /*font family ID*/
  29750.     short fSize; /*font size request*/
  29751.     short face; /*style (face) request*/
  29752.     short device; /*device requested*/
  29753.     Point inNumer; /*scale factors requested*/
  29754.     Point inDenom; /*scale factors requested*/
  29755.     short aFID; /*actual font family ID for table*/
  29756.     Handle fHand; /*family record used to build up table*/
  29757.     Boolean usedFam; /*used fixed point family widths*/
  29758.     unsigned char aFace; /*actual face produced*/
  29759.     short vOutput; /*vertical scale output value*/
  29760.     short hOutput; /*horizontal scale output value*/
  29761.     short vFactor; /*vertical scale output value*/
  29762.     short hFactor; /*horizontal scale output value*/
  29763.     short aSize; /*actual size of actual font used*/
  29764.     short tabSize; /*total size of table*/
  29765. };
  29766.  
  29767. typedef struct WidthTable WidthTable;
  29768. æC 
  29769. »Global Width Tables
  29770.  
  29771. Note:  The extensions to the Font Manager described in the following paragraphs
  29772.        were originally documented in Inside Macintosh, Volume IV.  As such,
  29773.        this information refers to the 128K ROMs and System file version 3.2
  29774.        and later.
  29775.  
  29776. The Font Manager communicates fractional character widths to QuickDraw via a global
  29777. width table, a data structure allocated in the system heap. A handle to the global
  29778. width table is returned by the FontMetrics procedure. The format of the global width
  29779. table is follows:
  29780.  
  29781. TYPE WidthTable = RECORD
  29782.                     tabData:  ARRAY[1..256] OF Fixed; { character widths}
  29783.                     tabFont:  Handle;   {font record used to build table}
  29784.                     sExtra:   LONGINT;  {space extra used for table}
  29785.                     style:    LONGINT;  {extra due to style}
  29786.                     fID:      INTEGER;  {font family ID}
  29787.                     fSize:    INTEGER;  {font size request}
  29788.                     face:     INTEGER;  {style (face) request}
  29789.                     device:   INTEGER;  {device requested}
  29790.                     inNumer:  Point;    {numerators of scaling factors}
  29791.                     inDenom:  Point;    {denominators of scaling factors}
  29792.                     aFID:     INTEGER;  {actual font family ID for table}
  29793.                     fHand:    handle;   {family record used to build table}
  29794.                     usedFam:  BOOLEAN;  {used fixed-point family widths}
  29795.                     aFace:    Byte;     {actual face produced}
  29796.                     vOutput:  INTEGER;  {vertical factor for expanding }
  29797.                                         { characters}
  29798.                     hOutput:  INTEGER;  {horizontal factor for expanding }
  29799.                                         { characters}
  29800.                     vFactor:  INTEGER;  {not used}
  29801.                     hFactor:  INTEGER;  {horizontal factor for increasing }
  29802.                                         { character widths}
  29803.                     aSize:    INTEGER;  {actual size of actual font used}
  29804.                     tabSize:  INTEGER   {total size of table}
  29805.                   END;
  29806.  
  29807. TabData is an array containing a character width for each of the 255 possible characters
  29808. in a font, plus one long word for the font’s missing symbol. The widths are stored in
  29809. the standard 32-bit fixed-point format. If a character is missing, its entry contains
  29810. the width of the missing symbol. (For efficiency, the Font Manager will store up to
  29811. 12 recently used global width tables.) InNumer and inDenom contain the vertical and
  29812. horizontal scaling factors copied from the font input record.
  29813.  
  29814. Scaling is effected in two ways:  by expanding characters of the chosen font and by
  29815. artificially increasing the widths of the chosen font in the width table. HOutput and
  29816. vOutput give the factors by which characters are to be expanded horizontally and
  29817. vertically. HFactor is the factor by which the widths of the chosen font, after
  29818. stylistic variations, have been increased. (VFactor is not used.) Thus, multiplying
  29819. hOutput and vOutput by hFactor and vFactor gives the true font scaling; the product
  29820. of hOutput and an entry in the width table is that character’s true scaled width.
  29821. HOutput,vOutput, hFactor, and vFactor are all 16-bit fixed-point numbers, with an
  29822. integer part in the high-order byte and a fractional part in the low-order byte.
  29823.  
  29824. If font scaling has been enabled, hFactor and vFactor both have a value of 1. In any
  29825. case, hOutput, vOutput, hFactor, and vFactor are adjusted so that the values of
  29826. hFactor and vFactor lie between 1 and 2, including 1.
  29827.  
  29828. Assembly-language note:  A handle to the global width table is contained
  29829.                          in the global variable WidthTabHandle. A pointer
  29830.                          to the table is contained in the global variable
  29831.                          WidthPtr; it’s reliable immediately after a call
  29832.                          to FMSwapFont but, like all pointers, may become
  29833.                          invalid after a call to the Memory Manager.
  29834.  
  29835.                          The global variable WidthListHand is a handle to a
  29836.                          list of handles to up to 12 recently-used width
  29837.                          tables. You can scan this list, looking for width
  29838.                          tables that match the family number, size, and style
  29839.                          of the font you wish to measure. If you reach a width
  29840.                          handle that’s equal to –1, that width table is
  29841.                          invalid, and you must make an FMSwapFont call to
  29842.                          get a valid one. When you reach a handle that’s zero,
  29843.                          you’ve reached the end of the list.
  29844.  
  29845.                          You should not use the global width table when
  29846.                          special international interface software is being
  29847.                          used to accommodate non-Roman alphabets. You can
  29848.                          recognize such software by looking at the global
  29849.                          variable IntlSpec; if it’s greater than 0, special
  29850.                          international software is installed. If your
  29851.                          application uses non-Roman alphabets, write to
  29852.  
  29853.                              Developer Technical Support
  29854.                              Apple Computer, Inc.
  29855.                              20525 Mariani Avenue, M/S 75-3T
  29856.                              Cupertino, CA 95014
  29857.  
  29858.                          for the latest version of the International Utilities
  29859.                          Package, which will be extended to handle non-Roman
  29860.                          alphabets.
  29861.  
  29862. æKY FamRec
  29863. æFc Fonts.h
  29864. æT struct
  29865. æD struct FamRec {
  29866.     short ffFlags; /*flags for family*/
  29867.     short ffFamID; /*family ID number*/
  29868.     short ffFirstChar; /*ASCII code of 1st character*/
  29869.     short ffLastChar; /*ASCII code of last character*/
  29870.     short ffAscent; /*maximum ascent for 1pt font*/
  29871.     short ffDescent; /*maximum descent for 1pt font*/
  29872.     short ffLeading; /*maximum leading for 1pt font*/
  29873.     short ffWidMax; /*maximum widMax for 1pt font*/
  29874.     long ffWTabOff; /*offset to width table*/
  29875.     long ffKernOff; /*offset to kerning table*/
  29876.     long ffStylOff; /*offset to style mapping table*/
  29877.     short ffProperty[9]; /*style property info*/
  29878.     short ffIntl[2]; /*for international use*/
  29879.     short ffVersion; /*version number*/
  29880. };
  29881.  
  29882. typedef struct FamRec FamRec;
  29883. æC 
  29884. »Family Records
  29885.  
  29886. Note:  The extensions to the Font Manager described in the following paragraphs
  29887.        were originally documented in Inside Macintosh, Volume IV.  As such,
  29888.        this information refers to the 128K ROMs and System file version 3.2
  29889.        and later.
  29890.  
  29891. Assembly-language note:  The global variable LastFOND is a handle to the last
  29892.                          family record used. You can read the contents of the
  29893.                          family record by using this handle. You should not
  29894.                          alter the contents of this record.
  29895.  
  29896. The data type for a family record is as follows:
  29897.  
  29898. TYPE FamRec = RECORD
  29899.                 ffFlags:      INTEGER;    {flags for family}
  29900.                 ffFamID:      INTEGER;    {family ID number}
  29901.                 ffFirstChar:  INTEGER;    {ASCII code of the first character}
  29902.                 ffLastChar:   INTEGER;    {ASCII code of the last character}
  29903.                 ffAscent:     INTEGER;    {maximum ascent for 1-pt.font}
  29904.                 ffDescent:    INTEGER;    {maximum descent for 1-pt.font}
  29905.                 ffLeading:    INTEGER;    {maximum leading for 1-pt.font}
  29906.                 ffWidMax:     INTEGER;    {maximum width for 1-pt.font}
  29907.                 ffWTabOff:    LONGINT;    {offset to width table}
  29908.                 ffKernOff:    LONGINT;    {offset to kerning table}
  29909.                 ffStylOff:    LONGINT;    {offset to style-mapping table}
  29910.                 ffProperty:   ARRAY[1..9] OF INTEGER; {style property info}
  29911.                 ffIntl:       ARRAY[1..2] OF INTEGER; {reserved}
  29912.                 ffVersion:    INTEGER;    {version number}
  29913.              {  ffAssoc:      FontAssoc;} {font association table}
  29914.              {  ffWidthTab:   WidTable;}  {width table}
  29915.              {  ffStyTab:     StyleTable;}{style-mapping table}
  29916.              {  ffKernTab:    KernTable;} {kerning table}
  29917.               END;
  29918.  
  29919. Note:  The variable-length arrays appear as comments because they’re not
  29920.        valid Pascal syntax; they’re used only as conceptual aids.  This
  29921.        version of the FamRec is accurate for Volume IV; the extensions to
  29922.        the FamRec made in Volume V are not included here.
  29923.  
  29924. The ffFlags field defines general characteristics of the font family, as follows:
  29925.  
  29926.   Bit    Meaning
  29927.   0      Set if there’s an image-height table
  29928.   1      Set if there’s a character-width table
  29929.   2–11   Reserved (should be zero)
  29930.   12     Set to ignore FractEnable when deciding whether to use
  29931.          fixed-point values for stylistic variations (see bit 13),
  29932.          clear to treat FractEnable as usual
  29933.   13     Set to use integer extra width for stylistic variations,
  29934.          clear to compute fixed-point extra width from the family
  29935.          style-mapping table when FractEnable is TRUE
  29936.   14     Set if family fractional-width table is not used, clear
  29937.          if table is used
  29938.   15     Set for fixed-width font, clear for proportional font
  29939.  
  29940. The values in the ffAscent, ffDescent, ffLeading, and ffWidMax describe the maximum
  29941. dimensions of the family as they would be for a hypothetical one-point font to be
  29942. scaled up. They use a special 16-bit fixed-point format with an integer part in the
  29943. high-order 4 bits and a fractional part in the low-order 12 bits. The FontMetrics
  29944. procedure calculates the true values by multiplying this number by the actual point
  29945. size.
  29946.  
  29947. The ffWTabOff, ffKernOff, and ffStylOff fields are offsets from the top of the record
  29948. to the start of the width table, kerning table, and style-mapping table, respectively;
  29949. if any of these fields is zero, the corresponding table does not exist.
  29950.  
  29951. The ffProperty field is the family style-property table, shown in Figure 11.
  29952.  
  29953. •••Refer to Figure 11.•••
  29954.  
  29955. Figure 11–Family Style-Property Table
  29956.  
  29957. Each entry is a 16-bit fixed-point number with a signed integer part in the high-order
  29958. 4 bits and a fractional part in the low-order 12 bits. These numbers are used to
  29959. calculate the amount of extra width for special stylistic variations; each of these
  29960. values is multiplied by the point size of the font actually being used. If the font
  29961. already exists for a given style, the value in its field is ignored.
  29962.  
  29963. The ffAssoc field contains the font association table. This table, shown in Figure
  29964. 12, is used to match a given font size and style combination with the resource ID of
  29965. an actual font.
  29966.  
  29967. •••Refer to Figure 12.•••
  29968.  
  29969. Figure 12–Font Association Table
  29970.  
  29971. Note:  In order to reduce search time, the Font Manager requires that
  29972.        the entries be sorted according to the fontSize field, with the
  29973.        smallest sizes first. If multiple fonts from the same family, the
  29974.        plain (roman) fonts come first. The Font Manager is optimized to
  29975.        look first for 'NFNT' resources, then 'FONT' resources.
  29976.  
  29977. Each entry in the font association table has the format shown in Figure 13.
  29978.  
  29979. •••Refer to Figure 13.•••
  29980.  
  29981. Figure 13–Font Association Table Entry
  29982.  
  29983. The font association table is followed by the family character-width table. As shown
  29984. in Figure 14, this table is actually a number of width tables (since a font family
  29985. may include numerous styles).
  29986.  
  29987. •••Refer to Figure 14.•••
  29988.  
  29989. Figure 14–Family Character-Width Table
  29990.  
  29991. Each character-width table is preceded by a style code; the low-order byte of this
  29992. word specifies stylistic variations (see Figure 15). The widths in each table are for
  29993. a hypothetical one-point font; the actual values for the characters are calculated by
  29994. multiplying these widths by the font size. The widths in this table are stored in a
  29995. 16-bit fixed-point format with an unsigned integer part in the high-order 4 bits and
  29996. a fractional part in the low-order 12 bits.
  29997.  
  29998. •••Refer to Figure 15.•••
  29999.  
  30000. Figure 15–Style Codes
  30001.  
  30002. The style-mapping table and its associated tables are used by the LaserWriter driver
  30003. and are described in the Apple LaserWriter Reference.
  30004.  
  30005. The kerning table, like the family character-width table, is actually a number of
  30006. kerning tables (see Figure 16).
  30007.  
  30008. •••Refer to Figure 16.•••
  30009.  
  30010. Figure 16–Kerning Table
  30011.  
  30012. Each kerning table is preceded by a style code; stored in the low-order byte of the
  30013. word, this style information has the same format shown in Figure 15 above. The number
  30014. of entries in the table follows the style word (see Figure 17).
  30015.  
  30016. •••Refer to Figure 17.•••
  30017.  
  30018. Figure 17–Structure of a Kerning Table
  30019.  
  30020. The entries in each kerning table (shown in Figure 18) consist of a pair of characters
  30021. followed by a kerning offset for a hypothetical one-point font. This value, represented
  30022. by an integer part in the high-order 4 bits and a fractional part in the low-order 12
  30023. bits, is multiplied by the size of the font to obtain the actual offset.
  30024.  
  30025. •••Refer to Figure 18.•••
  30026.  
  30027. Figure 18–Kerning Table Entry
  30028.  
  30029. Note:  The extensions to the Font Manager described in the following paragraphs
  30030.        were originally documented in Inside Macintosh, Volume V.  As such,
  30031.        this information refers to the Macintosh SE and Macintosh II ROMs and
  30032.        System file version 4.1 and later.
  30033.  
  30034. For Macintosh II only, bits 8 and 9 of the font style word within each font association
  30035. table specify the font depth; they must contain the same value as bits 2 and 3 of the
  30036. fontType field of the font record.  All other undefined bits remain 0.
  30037.  
  30038. A font family is stored as a resource of type 'FOND', and with the Macintosh II, it’s
  30039. format has been extended.  The new format is the following (with extension fields
  30040. indicated by asterisks):
  30041.  
  30042.   Number of bytes    Contents
  30043.  
  30044.       2 bytes        FONDFlags field of family record
  30045.       2 bytes        FONDFamID field of family record
  30046.       2 bytes        FONDFirst field of family record
  30047.       2 bytes        FONDLast field of family record
  30048.       2 bytes        FONDAscent field of family record
  30049.       2 bytes        FONDDescent field of family record
  30050.       2 bytes        FONDLeading field of family record
  30051.       2 bytes        FONDWidMax field of family record
  30052.       4 bytes        FONDWTabOff of family record
  30053.       4 bytes        FONDKernOff of family record
  30054.       4 bytes        FONDStylOff of family record
  30055.       24 bytes       FONDProperty field of family record
  30056.       4 bytes        FONDIntl field of family record
  30057.       2 bytes        *Version number ($02)
  30058.       m bytes        FONDAssoc field of family record (variable length)
  30059.       2 bytes        *Number of offsets minus 1
  30060.       4 bytes        *Offset to bounding box table
  30061.       n bytes        *Bounding box table
  30062.       p bytes        FONDWidTable field of family record (variable length)
  30063.       q bytes        FONDStylTab field of family record (variable length)
  30064.       r bytes        FONDKerntab field of family record (variable length)
  30065.  
  30066. The bounding box table has an entry for each style available in the family.  The
  30067. table as a whole has this form:
  30068.  
  30069.   Number of bytes    Contents
  30070.  
  30071.       2 bytes        Number of entries minus 1
  30072.       10 bytes       First entry
  30073.       10 bytes       Second entry . . .
  30074.  
  30075. Each bounding box entry has this form, giving the bounding box position with respect
  30076. to the origin of the characters:
  30077.  
  30078.   Number of bytes    Contents
  30079.  
  30080.       2 bytes        Style word
  30081.       2 bytes        Lower left x coordinate
  30082.       2 bytes        Lower left y coordinate
  30083.       2 bytes        Upper right x coordinate
  30084.       2 bytes        Upper right y coordinate
  30085.  
  30086. Note:  The extensions to the Font Manager described in the following paragraphs
  30087.        were originally documented in Inside Macintosh, Volume IV.  As such,
  30088.        this information refers to the 128K ROMs and System file version 3.2
  30089.        and later.
  30090.  
  30091. æKY InitFonts
  30092. æFc Fonts.h
  30093. æT Function
  30094. æTN A8FE
  30095. æD pascal void InitFonts(void)
  30096.     = 0xA8FE; 
  30097. æDT InitFonts()(void);
  30098. æMM
  30099. æRT 72
  30100. æRI I-222, P-31, 95, 101, 107, 112, 118, 174
  30101. æC  
  30102. InitFonts initializes the Font Manager. If the system font isn’t already in memory,
  30103. InitFonts reads it into memory. Call this procedure once before all other Font Manager
  30104. routines or any Toolbox routine that will call the Font Manager.
  30105.  
  30106. æKY GetFontName
  30107. æFc Fonts.h
  30108. æT Function
  30109. æTN A8FF
  30110. æD pascal void GetFontName(short familyID,Str255 theName)
  30111.     = 0xA8FF; 
  30112. æDT GetFontName((short) familyID,(Str255) theName);
  30113. æMM
  30114. æRT 191
  30115. æRI I-223
  30116. æC  
  30117. Warning:  Before returning, the routines in this section issue the Resource
  30118.           Manager call SetResLoad(TRUE). If your program previously called
  30119.           SetResLoad(FALSE) and you still want that to be in effect after
  30120.           calling one of these Font Manager routines, you’ll have to call
  30121.           SetResLoad(FALSE) again.
  30122.  
  30123. PROCEDURE GetFontName (fontNum:  INTEGER; VAR theName:  Str255);
  30124.  
  30125. Assembly-language note:  The macro you invoke to call GetFontName from
  30126.                          assembly language is named _GetFName.
  30127.  
  30128. GetFontName returns in theName the name of the font having the font number fontNum.
  30129. If there’s no such font, GetFontName returns the empty string.
  30130.  
  30131. æKY GetFNum
  30132. æFc Fonts.h
  30133. æT Function
  30134. æTN A900
  30135. æD pascal void GetFNum(const Str255 theName,short *familyID)
  30136.     = 0xA900; 
  30137. æDT GetFNum((const Str255) theName,(short *) familyID);
  30138. æMM
  30139. æRT 191
  30140. æRI I-223
  30141. æC  
  30142. Warning:  Before returning, the routines in this section issue the Resource
  30143.           Manager call SetResLoad(TRUE). If your program previously called
  30144.           SetResLoad(FALSE) and you still want that to be in effect after
  30145.           calling one of these Font Manager routines, you’ll have to call
  30146.           SetResLoad(FALSE) again.
  30147.  
  30148.  
  30149. GetFNum returns in theNum the font number for the font having the given fontName. If
  30150. there’s no such font, GetFNum returns 0.
  30151.  
  30152. æKY RealFont
  30153. æFc Fonts.h
  30154. æT Function
  30155. æTN A902
  30156. æD pascal Boolean RealFont(short fontNum,short size)
  30157.     = 0xA902; 
  30158. æDT Boolean myVariable = RealFont((short) fontNum,(short) size);
  30159. æMM
  30160. æRI I-223
  30161. æC  
  30162. Warning:  Before returning, the routines in this section issue the Resource
  30163.           Manager call SetResLoad(TRUE). If your program previously called
  30164.           SetResLoad(FALSE) and you still want that to be in effect after
  30165.           calling one of these Font Manager routines, you’ll have to call
  30166.           SetResLoad(FALSE) again.
  30167.  
  30168. RealFont returns TRUE if the font having the font number fontNum is available in the
  30169. given size in a resource file, or FALSE if the font has to be scaled to that size.
  30170.  
  30171. Note:  RealFont will always return FALSE if you pass applFont in fontNum.
  30172.        To find out if the application font is available in a particular
  30173.        size, call GetFontName and then GetFNum to get the actual font
  30174.        number for the application font, and then call RealFont with that number.
  30175.  
  30176. æKY SetFontLock
  30177. æFc Fonts.h
  30178. æT Function
  30179. æTN A903
  30180. æD pascal void SetFontLock(Boolean lockFlag)
  30181.     = 0xA903; 
  30182. æDT SetFontLock((Boolean) lockFlag);
  30183. æMM
  30184. æRI I-223
  30185. æC  
  30186. SetFontLock applies to the font in which text was most recently drawn. If lockFlag is
  30187. TRUE, SetFontLock makes the font unpurgeable (reading it into memory if it isn’t
  30188. already there). If lockFlag is FALSE, it releases the memory occupied by the font 
  30189. (by calling the Resource Manager procedure ReleaseResource).
  30190. Since fonts are normally purgeable, this procedure is useful for making a font temporarily
  30191. unpurgeable.
  30192.  
  30193. æKY FMSwapFont
  30194. æFc Fonts.h
  30195. æT Function
  30196. æTN A901
  30197. æD pascal FMOutPtr FMSwapFont(const FMInput *inRec)
  30198.     = 0xA901; 
  30199. æDT FMOutPtr myVariable = FMSwapFont((const FMInput *) inRec);
  30200. æMM
  30201. æRI I-223
  30202. æC 
  30203. The following low-level routine is called by QuickDraw and won’t normally be used by
  30204. an application directly, but it may be of interest to advanced programmers who want
  30205. to bypass the QuickDraw routines that deal with text.
  30206.  
  30207. FUNCTION FMSwapFont (inRec:  FMInput) :  FMOutPtr;
  30208.  
  30209. FMSwapFont returns a pointer to a font output record containing the size, style, and
  30210. other information about an adapted version of the font requested in the given font
  30211. input record. (Font input and output records are explained in the following section.)
  30212. FMSwapFont is called by QuickDraw every time a QuickDraw routine that does anything
  30213. with text is used. If you want to call FMSwapFont yourself, you must build a font
  30214. input record and then use the pointer returned by FMSwapFont to access the resulting
  30215. font output record.
  30216.  
  30217. æKY SetFScaleDisable
  30218. æFc Fonts.h
  30219. æT Function
  30220. æTN A834
  30221. æD pascal void SetFScaleDisable(Boolean fscaleDisable)
  30222.     = 0xA834; 
  30223. æDT SetFScaleDisable((Boolean) fscaleDisable);
  30224. æRI IV-32
  30225. æC  
  30226.  
  30227. Note:  The extensions to the Font Manager described in the following paragraphs
  30228.        were originally documented in Inside Macintosh, Volume IV.  As such,
  30229.        this information refers to the 128K ROMs and System file version 3.2
  30230.        and later.
  30231.  
  30232. SetFScaleDisable lets you disable or enable font scaling. If fScaleDisable is
  30233. TRUE, font scaling is disabled and the Font Manager returns an unscaled font with
  30234. more space around the characters; if it’s FALSE, the Font Manager scales fonts. To
  30235. ensure compatibility with existing applications, the Font Manager defaults to scaling
  30236. fonts.
  30237.  
  30238. Assembly-language note:  All programmers should use the SetFScaleDisable
  30239.                          procedure to disable and enable font scaling. In
  30240.                          particular, setting the global variable FScaleDisable
  30241.                          is insufficient.
  30242.  
  30243. æKY FontMetrics
  30244. æFc Fonts.h
  30245. æT Function
  30246. æTN A835
  30247. æD pascal void FontMetrics(const FMetricRec *theMetrics)
  30248.     = 0xA835; 
  30249. æDT FontMetrics((const FMetricRec *) theMetrics);
  30250. æMM
  30251. æRI IV-32
  30252. æC  
  30253. Note:  The extensions to the Font Manager described in the following paragraphs
  30254.        were originally documented in Inside Macintosh, Volume IV.  As such,
  30255.        this information refers to the 128K ROMs and System file version 3.2
  30256.        and later.
  30257.  
  30258. To improve the speed and readability of text display in your application, use the
  30259. SetFractEnable and SetFScaleDisable procedures to enable fractional character widths
  30260. and disable font scaling. Certain applications do not work properly when fractional
  30261. character widths are used and font scaling is disabled, so these features are turned
  30262. off by default.
  30263.  
  30264. The FontMetrics function is much like QuickDraw’s GetFontInfo function except that it
  30265. returns fixed-point values, letting you draw characters in more precise locations on
  30266. the screen.
  30267.  
  30268. If there’s a 'FOND' resource associated with the most recently drawn font, making the
  30269. font resource purgeable or unpurgeable with the SetFontLock procedure will make the
  30270. 'FOND' resource resource purgeable or unpurgeable as well.
  30271.  
  30272. PROCEDURE FontMetrics (VAR theMetrics:  FMetricRec);
  30273.  
  30274. FontMetrics is similar to the QuickDraw procedure GetFontInfo except that it returns
  30275. fixed-point values for greater accuracy in high-resolution printing.
  30276.  
  30277. The FMetricRec data structure is defined as follows:
  30278.  
  30279. TYPE FMetricRec = RECORD
  30280.                     ascent:      Fixed;    {ascent}
  30281.                     descent:     Fixed;    {descent}
  30282.                     leading:     Fixed;    {leading}
  30283.                     widMax:      Fixed;    {maximum character width}
  30284.                     wTabHandle:  Handle;   {handle to global width table}
  30285.                   END;
  30286.  
  30287. Ascent, descent, leading, and widMax are identical in function to their counterparts
  30288. in GetFontInfo. WTabHandle is a handle to the global width table
  30289. (described below).
  30290.  
  30291. æKY SetFractEnable
  30292. æFc Fonts.h
  30293. æT Function
  30294. æD pascal void SetFractEnable(Boolean fractEnable); 
  30295. æDT SetFractEnable((Boolean) fractEnable);
  30296. æRT 72
  30297. æRI V-180
  30298. æC  
  30299. Note:  The extensions to the Font Manager described in the following paragraphs
  30300.        were originally documented in Inside Macintosh, Volume IV.  As such,
  30301.        this information refers to the 128K ROMs and System file version 3.2
  30302.        and later.
  30303.  
  30304. SetFractEnable lets you enable or disable fractional character widths. If fractEnable
  30305. is TRUE, fractional character widths are enabled; if it’s FALSE, the Font Manager
  30306. uses integer widths. To ensure compatibility with existing applications, fractional
  30307. character widths are disabled by default.
  30308.  
  30309. SetFractEnable, which was not in the 128K ROM (but was available in the Pascal interfaces)
  30310. has been added to both the Macintosh SE and Macintosh II ROMs.
  30311.  
  30312. Assembly-language note:   Assembly-language programmers should call
  30313.                           SetFractEnable rather than change the value
  30314.                           of the global variable FractEnable.
  30315.  
  30316. æKY getfnum
  30317. æFc Fonts.h
  30318. æT Function
  30319. æD void getfnum(char *theName,short *familyID); 
  30320. æDT getfnum((char *) theName,(short *) familyID);
  30321. æMM
  30322. æRT 191
  30323. æRI I-223
  30324. æC  
  30325. Warning:  Before returning, the routines in this section issue the Resource
  30326.           Manager call SetResLoad(TRUE). If your program previously called
  30327.           SetResLoad(FALSE) and you still want that to be in effect after
  30328.           calling one of these Font Manager routines, you’ll have to call
  30329.           SetResLoad(FALSE) again.
  30330.  
  30331.  
  30332. GetFNum returns in theNum the font number for the font having the given fontName. If
  30333. there’s no such font, GetFNum returns 0.
  30334.  
  30335. æKY getfontname
  30336. æFc Fonts.h
  30337. æT Function
  30338. æD void getfontname(short familyID,char *theName); 
  30339. æDT getfontname((short) familyID,(char *) theName);
  30340. æMM
  30341. æRT 191
  30342. æRI I-223
  30343. æC  
  30344. Warning:  Before returning, the routines in this section issue the Resource
  30345.           Manager call SetResLoad(TRUE). If your program previously called
  30346.           SetResLoad(FALSE) and you still want that to be in effect after
  30347.           calling one of these Font Manager routines, you’ll have to call
  30348.           SetResLoad(FALSE) again.
  30349.  
  30350. PROCEDURE GetFontName (fontNum:  INTEGER; VAR theName:  Str255);
  30351.  
  30352. Assembly-language note:  The macro you invoke to call GetFontName from
  30353.                          assembly language is named _GetFName.
  30354.  
  30355. GetFontName returns in theName the name of the font having the font number fontNum.
  30356. If there’s no such font, GetFontName returns the empty string.
  30357.  
  30358.  
  30359. æKY GestaltEqu.h
  30360. æKL Gestalt
  30361. NewGestalt
  30362. ReplaceGestalt
  30363.  
  30364. gestalt32BitAddressing
  30365. gestalt32BitCapable
  30366. gestalt32BitQD
  30367. gestalt32BitSysZone
  30368. gestalt68000
  30369. gestalt68010
  30370. gestalt68020
  30371. gestalt68030
  30372. gestalt68030MMU
  30373. gestalt68040
  30374. gestalt68040FPU
  30375. gestalt68040MMU
  30376. gestalt68851
  30377. gestalt68881
  30378. gestalt68882
  30379. gestalt8BitQD
  30380. gestaltAddressingModeAttr
  30381. gestaltAliasMgrAttr
  30382. gestaltAliasMgrPresent
  30383. gestaltAMU
  30384. gestaltAppleEventsAttr
  30385. gestaltAppleEventsPresent
  30386. gestaltAppleTalkVersion
  30387. gestaltAUXVersion
  30388. gestaltClassic
  30389. gestaltCTBVersion
  30390. gestaltDBAccessMgrAttr
  30391. gestaltDBAccessMgrPresent
  30392. gestaltDupSelectorErr
  30393. gestaltEditionMgrAttr
  30394. gestaltEditionMgrPresent
  30395. gestaltElmerISOKbd
  30396. gestaltElmerKbd
  30397. gestaltExtADBKbd
  30398. gestaltExtendedTimeMgr
  30399. gestaltExtISOADBKbd
  30400. gestaltFolderMgrAttr
  30401. gestaltFolderMgrPresent
  30402. gestaltFontMgrAttr
  30403. gestaltFPUType
  30404. gestaltHardwareAttr
  30405. gestaltHasASC
  30406. gestaltHasParityCapability
  30407. gestaltHasSCC
  30408. gestaltHasSCSI
  30409. gestaltHasVIA1
  30410. gestaltHasVIA2
  30411. gestaltHelpMgrAttr
  30412. gestaltHelpMgrPresent
  30413. gestaltIPCSupport
  30414. gestaltKeyboardType
  30415. gestaltLaunchCanReturn
  30416. gestaltLaunchControl
  30417. gestaltLaunchFullFileSpec
  30418. gestaltLocationErr
  30419. gestaltLogicalPageSize
  30420. gestaltLogicalRAMSize
  30421. gestaltLowMemorySize
  30422. gestaltMac512KE
  30423. gestaltMacAndPad
  30424. gestaltMachineType
  30425. gestaltMacII
  30426. gestaltMacIIci
  30427. gestaltMacIIcx
  30428. gestaltMacIIfx
  30429. gestaltMacIIx
  30430. gestaltMacKbd
  30431. gestaltMacPlus
  30432. gestaltMacPlusKbd
  30433. gestaltMacSE
  30434. gestaltMacSE030
  30435. gestaltMacXL
  30436. gestaltMiscAttr
  30437. gestaltMMUType
  30438. gestaltNoFPU
  30439. gestaltNoMMU
  30440. gestaltNotificationMgrAttr
  30441. gestaltNotificationPresent
  30442. gestaltOriginalQD
  30443. gestaltOSAttr
  30444. gestaltOutlineFonts
  30445. gestaltParityAttr
  30446. gestaltParityEnabled
  30447. gestaltPartialRsrcs
  30448. gestaltPhysicalRAMSize
  30449. gestaltPMgrCPUIdle
  30450. gestaltPMgrExists
  30451. gestaltPMgrSCC
  30452. gestaltPMgrSound
  30453. gestaltPortable
  30454. gestaltPowerMgrAttr
  30455. gestaltPPCSupportsDontCare
  30456. gestaltPPCSupportsIncomming
  30457. gestaltPPCSupportsOutGoing
  30458. gestaltPPCSupportsRealTime
  30459. gestaltPPCSupportsStoreAndForward
  30460. gestaltPPCToolboxAttr
  30461. gestaltPPCToolboxPresent
  30462. gestaltProcessorType
  30463. gestaltPrtblADBKbd
  30464. gestaltPrtblISOKbd
  30465. gestaltQuickdrawVersion
  30466. gestaltRealTempMemory
  30467. gestaltResourceMgrAttr
  30468. gestaltRevisedTimeMgr
  30469. gestaltROMSize
  30470. gestaltROMVersion
  30471. gestaltScriptCount
  30472. gestaltScriptMgrVersion
  30473. gestaltScrollingThrottle
  30474. gestaltSoundAttr
  30475. gestaltStandardTimeMgr
  30476. gestaltStdADBKbd
  30477. gestaltStdISOADBKbd
  30478. gestaltStereoCapability
  30479. gestaltStereoMixing
  30480. gestaltSysDebuggerSupport
  30481. gestaltSystemVersion
  30482. gestaltSysZoneGrowable
  30483. gestaltTE1
  30484. gestaltTE2
  30485. gestaltTE3
  30486. gestaltTE4
  30487. gestaltTempMemSupport
  30488. gestaltTempMemTracked
  30489. gestaltTextEditVersion
  30490. gestaltTimeMgrVersion
  30491. gestaltUndefSelectorErr
  30492. gestaltUnknownErr
  30493. gestaltVersion
  30494. gestaltVMAttr
  30495. gestaltVMPresent
  30496.  
  30497. æKY gestaltUnknownErr
  30498. æFc GestaltEqu.h
  30499. æT #define
  30500. æD 
  30501. /* ***********************
  30502.  *    Gestalt error codes
  30503.  *********************** */
  30504.  
  30505. #define gestaltUnknownErr -5550 /* value returned if Gestalt doesn't know the answer */
  30506. æC 
  30507.  
  30508. æKY gestaltUndefSelectorErr
  30509. æFc GestaltEqu.h
  30510. æT #define
  30511. æD #define gestaltUndefSelectorErr -5551 /* undefined selector was passed to Gestalt */
  30512. æC 
  30513.  
  30514. æKY gestaltDupSelectorErr
  30515. æFc GestaltEqu.h
  30516. æT #define
  30517. æD #define gestaltDupSelectorErr -5552 /* tried to add an entry that already existed */
  30518. æC 
  30519.  
  30520. æKY gestaltLocationErr
  30521. æFc GestaltEqu.h
  30522. æT #define
  30523. æD #define gestaltLocationErr -5553 /* gestalt function ptr wasn't in sysheap */
  30524. æC 
  30525.  
  30526. æKY gestaltVersion
  30527. æFc GestaltEqu.h
  30528. æT #define
  30529. æD 
  30530. /* *************************
  30531.  *    Environment Selectors
  30532.  ************************* */
  30533.  
  30534. #define gestaltVersion 'vers' /* gestalt version */
  30535. æC 
  30536.  
  30537. æKY gestaltAddressingModeAttr
  30538. æFc GestaltEqu.h
  30539. æT #define
  30540. æD #define gestaltAddressingModeAttr 'addr' /* addressing mode attributes */
  30541. æC 
  30542.  
  30543. æKY gestalt32BitAddressing
  30544. æFc GestaltEqu.h
  30545. æT #define
  30546. æD #define gestalt32BitAddressing 0 /* using 32-bit addressing mode */
  30547. æC 
  30548.  
  30549. æKY gestalt32BitSysZone
  30550. æFc GestaltEqu.h
  30551. æT #define
  30552. æD #define gestalt32BitSysZone 1 /* 32-bit compatible system zone */
  30553. æC 
  30554.  
  30555. æKY gestalt32BitCapable
  30556. æFc GestaltEqu.h
  30557. æT #define
  30558. æD #define gestalt32BitCapable 2 /* Machine is 32-bit capable */
  30559. æC 
  30560.  
  30561. æKY gestaltAliasMgrAttr
  30562. æFc GestaltEqu.h
  30563. æT #define
  30564. æD #define gestaltAliasMgrAttr 'alis' /* Alias Mgr Attributes */
  30565. æC 
  30566.  
  30567. æKY gestaltAliasMgrPresent
  30568. æFc GestaltEqu.h
  30569. æT #define
  30570. æD #define gestaltAliasMgrPresent 0 /* True if the Alias Mgr is present */
  30571. æC 
  30572.  
  30573. æKY gestaltAppleTalkVersion
  30574. æFc GestaltEqu.h
  30575. æT #define
  30576. æD #define gestaltAppleTalkVersion 'atlk' /* appletalk version */
  30577. æC 
  30578.  
  30579. æKY gestaltAUXVersion
  30580. æFc GestaltEqu.h
  30581. æT #define
  30582. æD #define gestaltAUXVersion 'a/ux' /*a/ux version, if present */
  30583. æC 
  30584.  
  30585. æKY gestaltCTBVersion
  30586. æFc GestaltEqu.h
  30587. æT #define
  30588. æD #define gestaltCTBVersion 'ctbv' /* CommToolbox version */
  30589. æC 
  30590.  
  30591. æKY gestaltDBAccessMgrAttr
  30592. æFc GestaltEqu.h
  30593. æT #define
  30594. æD #define gestaltDBAccessMgrAttr 'dbac' /* Database Access Mgr attributes */
  30595. æC 
  30596.  
  30597. æKY gestaltDBAccessMgrPresent
  30598. æFc GestaltEqu.h
  30599. æT #define
  30600. æD #define gestaltDBAccessMgrPresent 0 /* True if Database Access Mgr present */
  30601. æC 
  30602.  
  30603. æKY gestaltEditionMgrAttr
  30604. æFc GestaltEqu.h
  30605. æT #define
  30606. æD #define gestaltEditionMgrAttr 'edtn' /* Edition Mgr attributes */
  30607. æC 
  30608.  
  30609. æKY gestaltEditionMgrPresent
  30610. æFc GestaltEqu.h
  30611. æT #define
  30612. æD #define gestaltEditionMgrPresent 0 /* True if Edition Mgr present */
  30613. æC 
  30614.  
  30615. æKY gestaltAppleEventsAttr
  30616. æFc GestaltEqu.h
  30617. æT #define
  30618. æD #define gestaltAppleEventsAttr 'evnt' /* Apple Events attributes */
  30619. æC 
  30620.  
  30621. æKY gestaltAppleEventsPresent
  30622. æFc GestaltEqu.h
  30623. æT #define
  30624. æD #define gestaltAppleEventsPresent 0 /* True if Apple Events present */
  30625. æC 
  30626.  
  30627. æKY gestaltFolderMgrAttr
  30628. æFc GestaltEqu.h
  30629. æT #define
  30630. æD #define gestaltFolderMgrAttr 'fold' /* Folder Mgr attributes */
  30631. æC 
  30632.  
  30633. æKY gestaltFolderMgrPresent
  30634. æFc GestaltEqu.h
  30635. æT #define
  30636. æD #define gestaltFolderMgrPresent 0 /* True if Folder Mgr present */
  30637. æC 
  30638.  
  30639. æKY gestaltFontMgrAttr
  30640. æFc GestaltEqu.h
  30641. æT #define
  30642. æD #define gestaltFontMgrAttr 'font' /* Font Mgr attributes */
  30643. æC 
  30644.  
  30645. æKY gestaltOutlineFonts
  30646. æFc GestaltEqu.h
  30647. æT #define
  30648. æD #define gestaltOutlineFonts 0 /* True if Outline Fonts supported */
  30649. æC 
  30650.  
  30651. æKY gestaltFPUType
  30652. æFc GestaltEqu.h
  30653. æT #define
  30654. æD #define gestaltFPUType 'fpu ' /* fpu type */
  30655. æC 
  30656.  
  30657. æKY gestaltNoFPU
  30658. æFc GestaltEqu.h
  30659. æT #define
  30660. æD #define gestaltNoFPU 0 /* no FPU */
  30661. æC 
  30662.  
  30663. æKY gestalt68881
  30664. æFc GestaltEqu.h
  30665. æT #define
  30666. æD #define gestalt68881 1 /* 68881 FPU */
  30667. æC 
  30668.  
  30669. æKY gestalt68882
  30670. æFc GestaltEqu.h
  30671. æT #define
  30672. æD #define gestalt68882 2 /* 68882 FPU */
  30673. æC 
  30674.  
  30675. æKY gestalt68040FPU
  30676. æFc GestaltEqu.h
  30677. æT #define
  30678. æD #define gestalt68040FPU 3 /* 68040 built-in FPU */
  30679. æC 
  30680.  
  30681. æKY gestaltHardwareAttr
  30682. æFc GestaltEqu.h
  30683. æT #define
  30684. æD #define gestaltHardwareAttr 'hdwr' /* hardware attributes */
  30685. æC 
  30686.  
  30687. æKY gestaltHasVIA1
  30688. æFc GestaltEqu.h
  30689. æT #define
  30690. æD #define gestaltHasVIA1 0 /* VIA1 exists */
  30691. æC 
  30692.  
  30693. æKY gestaltHasVIA2
  30694. æFc GestaltEqu.h
  30695. æT #define
  30696. æD #define gestaltHasVIA2 1 /* VIA2 exists */
  30697. æC 
  30698.  
  30699. æKY gestaltHasASC
  30700. æFc GestaltEqu.h
  30701. æT #define
  30702. æD #define gestaltHasASC 3 /* Apple Sound Chip exists */
  30703. æC 
  30704.  
  30705. æKY gestaltHasSCC
  30706. æFc GestaltEqu.h
  30707. æT #define
  30708. æD #define gestaltHasSCC 4 /* SCC exists */
  30709. æC 
  30710.  
  30711. æKY gestaltHasSCSI
  30712. æFc GestaltEqu.h
  30713. æT #define
  30714. æD #define gestaltHasSCSI 7 /* SCSI exists */
  30715. æC 
  30716.  
  30717. æKY gestaltHelpMgrAttr
  30718. æFc GestaltEqu.h
  30719. æT #define
  30720. æD #define gestaltHelpMgrAttr 'help' /* Help Mgr Attributes */
  30721. æC 
  30722.  
  30723. æKY gestaltHelpMgrPresent
  30724. æFc GestaltEqu.h
  30725. æT #define
  30726. æD #define gestaltHelpMgrPresent 0 /* true if help mgr is present */
  30727. æC 
  30728.  
  30729. æKY gestaltKeyboardType
  30730. æFc GestaltEqu.h
  30731. æT #define
  30732. æD #define gestaltKeyboardType 'kbd ' /* keyboard type */
  30733. æC 
  30734.  
  30735. æKY gestaltMacKbd
  30736. æFc GestaltEqu.h
  30737. æT #define
  30738. æD #define gestaltMacKbd 1
  30739. æC 
  30740.  
  30741. æKY gestaltMacAndPad
  30742. æFc GestaltEqu.h
  30743. æT #define
  30744. æD #define gestaltMacAndPad 2
  30745. æC 
  30746.  
  30747. æKY gestaltMacPlusKbd
  30748. æFc GestaltEqu.h
  30749. æT #define
  30750. æD #define gestaltMacPlusKbd 3
  30751. æC 
  30752.  
  30753. æKY gestaltExtADBKbd
  30754. æFc GestaltEqu.h
  30755. æT #define
  30756. æD #define gestaltExtADBKbd 4
  30757. æC 
  30758.  
  30759. æKY gestaltStdADBKbd
  30760. æFc GestaltEqu.h
  30761. æT #define
  30762. æD #define gestaltStdADBKbd 5
  30763. æC 
  30764.  
  30765. æKY gestaltPrtblADBKbd
  30766. æFc GestaltEqu.h
  30767. æT #define
  30768. æD #define gestaltPrtblADBKbd 6
  30769. æC 
  30770.  
  30771. æKY gestaltPrtblISOKbd
  30772. æFc GestaltEqu.h
  30773. æT #define
  30774. æD #define gestaltPrtblISOKbd 7
  30775. æC 
  30776.  
  30777. æKY gestaltStdISOADBKbd
  30778. æFc GestaltEqu.h
  30779. æT #define
  30780. æD #define gestaltStdISOADBKbd 8
  30781. æC 
  30782.  
  30783. æKY gestaltExtISOADBKbd
  30784. æFc GestaltEqu.h
  30785. æT #define
  30786. æD #define gestaltExtISOADBKbd 9
  30787. æC 
  30788.  
  30789. æKY gestaltElmerKbd
  30790. æFc GestaltEqu.h
  30791. æT #define
  30792. æD #define gestaltElmerKbd 10
  30793. æC 
  30794.  
  30795. æKY gestaltElmerISOKbd
  30796. æFc GestaltEqu.h
  30797. æT #define
  30798. æD #define gestaltElmerISOKbd 11
  30799. æC 
  30800.  
  30801. æKY gestaltLowMemorySize
  30802. æFc GestaltEqu.h
  30803. æT #define
  30804. æD #define gestaltLowMemorySize 'lmem' /* size of low memory area */
  30805. æC 
  30806.  
  30807. æKY gestaltLogicalRAMSize
  30808. æFc GestaltEqu.h
  30809. æT #define
  30810. æD #define gestaltLogicalRAMSize 'lram' /* logical ram size */
  30811. æC 
  30812.  
  30813. æKY gestaltMiscAttr
  30814. æFc GestaltEqu.h
  30815. æT #define
  30816. æD #define gestaltMiscAttr 'misc' /* miscellaneous attributes */
  30817. æC 
  30818.  
  30819. æKY gestaltScrollingThrottle
  30820. æFc GestaltEqu.h
  30821. æT #define
  30822. æD #define gestaltScrollingThrottle 0 /* true if scrolling throttle on */
  30823. æC 
  30824.  
  30825. æKY gestaltMMUType
  30826. æFc GestaltEqu.h
  30827. æT #define
  30828. æD #define gestaltMMUType 'mmu ' /* mmu type */
  30829. æC 
  30830.  
  30831. æKY gestaltNoMMU
  30832. æFc GestaltEqu.h
  30833. æT #define
  30834. æD #define gestaltNoMMU 0 /* no MMU */
  30835. æC 
  30836.  
  30837. æKY gestaltAMU
  30838. æFc GestaltEqu.h
  30839. æT #define
  30840. æD #define gestaltAMU 1 /* address management unit */
  30841. æC 
  30842.  
  30843. æKY gestalt68851
  30844. æFc GestaltEqu.h
  30845. æT #define
  30846. æD #define gestalt68851 2 /* 68851 PMMU */
  30847. æC 
  30848.  
  30849. æKY gestalt68030MMU
  30850. æFc GestaltEqu.h
  30851. æT #define
  30852. æD #define gestalt68030MMU 3 /* 68030 built-in MMU */
  30853. æC 
  30854.  
  30855. æKY gestalt68040MMU
  30856. æFc GestaltEqu.h
  30857. æT #define
  30858. æD #define gestalt68040MMU 4 /* 68040 built-in MMU */
  30859. æC 
  30860.  
  30861. æKY gestaltNotificationMgrAttr
  30862. æFc GestaltEqu.h
  30863. æT #define
  30864. æD #define gestaltNotificationMgrAttr 'nmgr' /* notification manager attributes */
  30865. æC 
  30866.  
  30867. æKY gestaltNotificationPresent
  30868. æFc GestaltEqu.h
  30869. æT #define
  30870. æD #define gestaltNotificationPresent 0 /* notification manager exists */
  30871. æC 
  30872.  
  30873. æKY gestaltOSAttr
  30874. æFc GestaltEqu.h
  30875. æT #define
  30876. æD #define gestaltOSAttr 'os  ' /* o/s attributes */
  30877. æC 
  30878.  
  30879. æKY gestaltSysZoneGrowable
  30880. æFc GestaltEqu.h
  30881. æT #define
  30882. æD #define gestaltSysZoneGrowable 0 /* system heap is growable */
  30883. æC 
  30884.  
  30885. æKY gestaltLaunchCanReturn
  30886. æFc GestaltEqu.h
  30887. æT #define
  30888. æD #define gestaltLaunchCanReturn 1 /* can return from launch */
  30889. æC 
  30890.  
  30891. æKY gestaltLaunchFullFileSpec
  30892. æFc GestaltEqu.h
  30893. æT #define
  30894. æD #define gestaltLaunchFullFileSpec 2 /* can launch from full file spec */
  30895. æC 
  30896.  
  30897. æKY gestaltLaunchControl
  30898. æFc GestaltEqu.h
  30899. æT #define
  30900. æD #define gestaltLaunchControl 3 /* launch control support available */
  30901. æC 
  30902.  
  30903. æKY gestaltTempMemSupport
  30904. æFc GestaltEqu.h
  30905. æT #define
  30906. æD #define gestaltTempMemSupport 4 /* temp memory support */
  30907. æC 
  30908.  
  30909. æKY gestaltRealTempMemory
  30910. æFc GestaltEqu.h
  30911. æT #define
  30912. æD #define gestaltRealTempMemory 5 /* temp memory handles are real */
  30913. æC 
  30914.  
  30915. æKY gestaltTempMemTracked
  30916. æFc GestaltEqu.h
  30917. æT #define
  30918. æD #define gestaltTempMemTracked 6 /* temporary memory handles are tracked */
  30919. æC 
  30920.  
  30921. æKY gestaltIPCSupport
  30922. æFc GestaltEqu.h
  30923. æT #define
  30924. æD #define gestaltIPCSupport 7 /* IPC support is present */
  30925. æC 
  30926.  
  30927. æKY gestaltSysDebuggerSupport
  30928. æFc GestaltEqu.h
  30929. æT #define
  30930. æD #define gestaltSysDebuggerSupport 8 /* system debugger support is present */
  30931. æC 
  30932.  
  30933. æKY gestaltLogicalPageSize
  30934. æFc GestaltEqu.h
  30935. æT #define
  30936. æD #define gestaltLogicalPageSize 'pgsz' /* logical page size */
  30937. æC 
  30938.  
  30939. æKY gestaltPowerMgrAttr
  30940. æFc GestaltEqu.h
  30941. æT #define
  30942. æD #define gestaltPowerMgrAttr 'powr' /* power manager attributes */
  30943. æC 
  30944.  
  30945. æKY gestaltPMgrExists
  30946. æFc GestaltEqu.h
  30947. æT #define
  30948. æD #define gestaltPMgrExists 0
  30949. æC 
  30950.  
  30951. æKY gestaltPMgrCPUIdle
  30952. æFc GestaltEqu.h
  30953. æT #define
  30954. æD #define gestaltPMgrCPUIdle 1
  30955. æC 
  30956.  
  30957. æKY gestaltPMgrSCC
  30958. æFc GestaltEqu.h
  30959. æT #define
  30960. æD #define gestaltPMgrSCC 2
  30961. æC 
  30962.  
  30963. æKY gestaltPMgrSound
  30964. æFc GestaltEqu.h
  30965. æT #define
  30966. æD #define gestaltPMgrSound 3
  30967. æC 
  30968.  
  30969. æKY gestaltPPCToolboxAttr
  30970. æFc GestaltEqu.h
  30971. æT #define
  30972. æD #define gestaltPPCToolboxAttr 'ppc ' /* PPC toolbox attributes */
  30973. æC 
  30974.  
  30975. æKY gestaltPPCToolboxPresent
  30976. æFc GestaltEqu.h
  30977. æT #define
  30978. æD 
  30979. /* 
  30980.  * PPC will return the combination of following bit fields.
  30981.  * e.g. gestaltPPCSupportsRealTime +gestaltPPCSupportsIncomming + gestaltPPCSupportsOutGoing
  30982.  * indicates PPC is cuurently is only supports real time delivery
  30983.  * and both icoming and outgoing network sessions are allowed.
  30984.  * By default local real time delivery is supported as long as PPCInit has been called.
  30985.  */
  30986.  
  30987. #define gestaltPPCToolboxPresent 0x0000 /* PPC Toolbox is present  Requires PPCInit to be called */
  30988. æC 
  30989.  
  30990. æKY gestaltPPCSupportsRealTime
  30991. æFc GestaltEqu.h
  30992. æT #define
  30993. æD #define gestaltPPCSupportsRealTime 0x1000 /* PPC Supports real-time delivery */
  30994. æC 
  30995.  
  30996. æKY gestaltPPCSupportsStoreAndForward
  30997. æFc GestaltEqu.h
  30998. æT #define
  30999. æD #define gestaltPPCSupportsStoreAndForward 0x2000 /* PPC Store and Forward  delivery */
  31000. æC 
  31001.  
  31002. æKY gestaltPPCSupportsDontCare
  31003. æFc GestaltEqu.h
  31004. æT #define
  31005. æD #define gestaltPPCSupportsDontCare 0x4000 /* PPC Supports  Specification of Don't care */
  31006. æC 
  31007.  
  31008. æKY gestaltPPCSupportsIncomming
  31009. æFc GestaltEqu.h
  31010. æT #define
  31011. æD #define gestaltPPCSupportsIncomming 0x0001 /* PPC will deny incomming network requests */
  31012. æC 
  31013.  
  31014. æKY gestaltPPCSupportsOutGoing
  31015. æFc GestaltEqu.h
  31016. æT #define
  31017. æD #define gestaltPPCSupportsOutGoing 0x0002 /* PPC will deny outgoing network requests */
  31018. æC 
  31019.  
  31020. æKY gestaltProcessorType
  31021. æFc GestaltEqu.h
  31022. æT #define
  31023. æD #define gestaltProcessorType 'proc' /* processor type */
  31024. æC 
  31025.  
  31026. æKY gestalt68000
  31027. æFc GestaltEqu.h
  31028. æT #define
  31029. æD #define gestalt68000 1
  31030. æC 
  31031.  
  31032. æKY gestalt68010
  31033. æFc GestaltEqu.h
  31034. æT #define
  31035. æD #define gestalt68010 2
  31036. æC 
  31037.  
  31038. æKY gestalt68020
  31039. æFc GestaltEqu.h
  31040. æT #define
  31041. æD #define gestalt68020 3
  31042. æC 
  31043.  
  31044. æKY gestalt68030
  31045. æFc GestaltEqu.h
  31046. æT #define
  31047. æD #define gestalt68030 4
  31048. æC 
  31049.  
  31050. æKY gestalt68040
  31051. æFc GestaltEqu.h
  31052. æT #define
  31053. æD #define gestalt68040 5
  31054. æC 
  31055.  
  31056. æKY gestaltParityAttr
  31057. æFc GestaltEqu.h
  31058. æT #define
  31059. æD #define gestaltParityAttr 'prty' /* parity attributes */
  31060. æC 
  31061.  
  31062. æKY gestaltHasParityCapability
  31063. æFc GestaltEqu.h
  31064. æT #define
  31065. æD #define gestaltHasParityCapability 0 /* has ability to check parity */
  31066. æC 
  31067.  
  31068. æKY gestaltParityEnabled
  31069. æFc GestaltEqu.h
  31070. æT #define
  31071. æD #define gestaltParityEnabled 1 /* parity checking enabled */
  31072. æC 
  31073.  
  31074. æKY gestaltQuickdrawVersion
  31075. æFc GestaltEqu.h
  31076. æT #define
  31077. æD #define gestaltQuickdrawVersion 'qd  ' /* quickdraw version */
  31078. æC 
  31079.  
  31080. æKY gestaltOriginalQD
  31081. æFc GestaltEqu.h
  31082. æT #define
  31083. æD #define gestaltOriginalQD 0x000 /* original 1-bit QD            <3.2> */
  31084. æC 
  31085.  
  31086. æKY gestalt8BitQD
  31087. æFc GestaltEqu.h
  31088. æT #define
  31089. æD #define gestalt8BitQD 0x100 /* 8-bit color QD                <3.2> */
  31090. æC 
  31091.  
  31092. æKY gestalt32BitQD
  31093. æFc GestaltEqu.h
  31094. æT #define
  31095. æD #define gestalt32BitQD 0x200 /* 32-bit color QD                <3.2> */
  31096. æC 
  31097.  
  31098. æKY gestaltPhysicalRAMSize
  31099. æFc GestaltEqu.h
  31100. æT #define
  31101. æD #define gestaltPhysicalRAMSize 'ram ' /* physical RAM size */
  31102. æC 
  31103.  
  31104. æKY gestaltResourceMgrAttr
  31105. æFc GestaltEqu.h
  31106. æT #define
  31107. æD #define gestaltResourceMgrAttr 'rsrc' /* Resource Mgr attributes */
  31108. æC 
  31109.  
  31110. æKY gestaltPartialRsrcs
  31111. æFc GestaltEqu.h
  31112. æT #define
  31113. æD #define gestaltPartialRsrcs 0 /* True if partial resources exist */
  31114. æC 
  31115.  
  31116. æKY gestaltScriptMgrVersion
  31117. æFc GestaltEqu.h
  31118. æT #define
  31119. æD #define gestaltScriptMgrVersion 'scri' /* Script Manager version number    <08/05/89 pke> */
  31120. æC 
  31121.  
  31122. æKY gestaltScriptCount
  31123. æFc GestaltEqu.h
  31124. æT #define
  31125. æD #define gestaltScriptCount 'scr#' /* number of active script systems    <08/05/89 pke> */
  31126. æC 
  31127.  
  31128. æKY gestaltSoundAttr
  31129. æFc GestaltEqu.h
  31130. æT #define
  31131. æD #define gestaltSoundAttr 'snd ' /* sound attributes */
  31132. æC 
  31133.  
  31134. æKY gestaltStereoCapability
  31135. æFc GestaltEqu.h
  31136. æT #define
  31137. æD #define gestaltStereoCapability 0 /* sound hardware has stereo capability */
  31138. æC 
  31139.  
  31140. æKY gestaltStereoMixing
  31141. æFc GestaltEqu.h
  31142. æT #define
  31143. æD #define gestaltStereoMixing 1 /* stereo mixing on external speaker */
  31144. æC 
  31145.  
  31146. æKY gestaltTextEditVersion
  31147. æFc GestaltEqu.h
  31148. æT #define
  31149. æD #define gestaltTextEditVersion 'te  ' /* TextEdit version number            <08/05/89 pke> */
  31150. æC 
  31151.  
  31152. æKY gestaltTE1
  31153. æFc GestaltEqu.h
  31154. æT #define
  31155. æD #define gestaltTE1 1 /* TextEdit in MacIIci ROM <8Aug89smb> */
  31156. æC 
  31157.  
  31158. æKY gestaltTE2
  31159. æFc GestaltEqu.h
  31160. æT #define
  31161. æD #define gestaltTE2 2 /* TextEdit with 6.0.4 Script Systems on MacIIci (Script bug fixes for MacIIci) <8Aug89smb> */
  31162. æC 
  31163.  
  31164. æKY gestaltTE3
  31165. æFc GestaltEqu.h
  31166. æT #define
  31167. æD #define gestaltTE3 3 /* TextEdit with 6.0.4 Script Systems all but MacIIci <8Aug89smb> */
  31168. æC 
  31169.  
  31170. æKY gestaltTE4
  31171. æFc GestaltEqu.h
  31172. æT #define
  31173. æD 
  31174. /*  **** Following is for System 7.0 Only **** */
  31175.  
  31176. #define gestaltTE4 4 /* TextEdit in System 7.0*/
  31177. æC 
  31178.  
  31179. æKY gestaltTimeMgrVersion
  31180. æFc GestaltEqu.h
  31181. æT #define
  31182. æD #define gestaltTimeMgrVersion 'tmgr' /* time mgr version */
  31183. æC 
  31184.  
  31185. æKY gestaltStandardTimeMgr
  31186. æFc GestaltEqu.h
  31187. æT #define
  31188. æD #define gestaltStandardTimeMgr 1 /* standard time mgr is present */
  31189. æC 
  31190.  
  31191. æKY gestaltRevisedTimeMgr
  31192. æFc GestaltEqu.h
  31193. æT #define
  31194. æD #define gestaltRevisedTimeMgr 2 /* revised time mgr is present */
  31195. æC 
  31196.  
  31197. æKY gestaltExtendedTimeMgr
  31198. æFc GestaltEqu.h
  31199. æT #define
  31200. æD #define gestaltExtendedTimeMgr 3 /* extended time mgr is present */
  31201. æC 
  31202.  
  31203. æKY gestaltVMAttr
  31204. æFc GestaltEqu.h
  31205. æT #define
  31206. æD #define gestaltVMAttr 'vm  ' /* virtual memory attributes */
  31207. æC 
  31208.  
  31209. æKY gestaltVMPresent
  31210. æFc GestaltEqu.h
  31211. æT #define
  31212. æD #define gestaltVMPresent 0 /* true if virtual memory is present */
  31213. æC 
  31214.  
  31215. æKY gestaltMachineType
  31216. æFc GestaltEqu.h
  31217. æT #define
  31218. æD 
  31219. /* ************************
  31220.  *    Info-only selectors
  31221.  *********************** */
  31222.  
  31223. #define gestaltMachineType 'mach' /* machine type */
  31224. æC 
  31225.  
  31226. æKY gestaltClassic
  31227. æFc GestaltEqu.h
  31228. æT #define
  31229. æD #define gestaltClassic 1
  31230. æC 
  31231.  
  31232. æKY gestaltMacXL
  31233. æFc GestaltEqu.h
  31234. æT #define
  31235. æD #define gestaltMacXL 2
  31236. æC 
  31237.  
  31238. æKY gestaltMac512KE
  31239. æFc GestaltEqu.h
  31240. æT #define
  31241. æD #define gestaltMac512KE 3
  31242. æC 
  31243.  
  31244. æKY gestaltMacPlus
  31245. æFc GestaltEqu.h
  31246. æT #define
  31247. æD #define gestaltMacPlus 4
  31248. æC 
  31249.  
  31250. æKY gestaltMacSE
  31251. æFc GestaltEqu.h
  31252. æT #define
  31253. æD #define gestaltMacSE 5
  31254. æC 
  31255.  
  31256. æKY gestaltMacII
  31257. æFc GestaltEqu.h
  31258. æT #define
  31259. æD #define gestaltMacII 6
  31260. æC 
  31261.  
  31262. æKY gestaltMacIIx
  31263. æFc GestaltEqu.h
  31264. æT #define
  31265. æD #define gestaltMacIIx 7
  31266. æC 
  31267.  
  31268. æKY gestaltMacIIcx
  31269. æFc GestaltEqu.h
  31270. æT #define
  31271. æD #define gestaltMacIIcx 8
  31272. æC 
  31273.  
  31274. æKY gestaltMacSE030
  31275. æFc GestaltEqu.h
  31276. æT #define
  31277. æD #define gestaltMacSE030 9
  31278. æC 
  31279.  
  31280. æKY gestaltPortable
  31281. æFc GestaltEqu.h
  31282. æT #define
  31283. æD #define gestaltPortable 10
  31284. æC 
  31285.  
  31286. æKY gestaltMacIIci
  31287. æFc GestaltEqu.h
  31288. æT #define
  31289. æD #define gestaltMacIIci 11
  31290. æC 
  31291.  
  31292. æKY gestaltMacIIfx
  31293. æFc GestaltEqu.h
  31294. æT #define
  31295. æD #define gestaltMacIIfx 13
  31296. æC 
  31297.  
  31298. æKY gestaltROMSize
  31299. æFc GestaltEqu.h
  31300. æT #define
  31301. æD #define gestaltROMSize 'rom ' /* rom size */
  31302. æC 
  31303.  
  31304. æKY gestaltROMVersion
  31305. æFc GestaltEqu.h
  31306. æT #define
  31307. æD #define gestaltROMVersion 'romv' /* rom version */
  31308. æC 
  31309.  
  31310. æKY gestaltSystemVersion
  31311. æFc GestaltEqu.h
  31312. æT #define
  31313. æD #define gestaltSystemVersion 'sysv' /* system version*/
  31314. æC 
  31315.  
  31316. æKY Gestalt
  31317. æFc GestaltEqu.h
  31318. æT Function
  31319. æD pascal OSErr Gestalt(OSType selector,long *response); 
  31320. æDT OSErr myVariable = Gestalt((OSType) selector,(long *) response);
  31321. æC 
  31322. Use the Gestalt function to obtain information about the operating environment.
  31323. The information you need is indicated by the selector parameter, which Gestalt
  31324. must already recognize.
  31325.  
  31326. Trap macro  _Gestalt
  31327. On entry    D0: selector code
  31328. On exit     A0: response
  31329.             D0: result code
  31330.  
  31331. Upon successful completion of the function, the response parameter contains the
  31332. information requested. Note that Gestalt returns the results from all function
  31333. selectors in a long integer, occupying 4 bytes. In some cases, not all 4 bytes
  31334. are needed to hold the returned information, in which case Gestalt places the
  31335. information in the low-order bytes of the response parameter.
  31336.  
  31337. Result codes
  31338. noErr                        0  No error
  31339. gestaltUnknownErr        –5550  Could not obtain the response
  31340. gestaltUndefSelectorErr  –5551  Undefined selector
  31341.  
  31342. æKY NewGestalt
  31343. æFc GestaltEqu.h
  31344. æT Function
  31345. æD pascal OSErr NewGestalt(OSType selector,ProcPtr gestaltFunction); 
  31346. æDT OSErr myVariable = NewGestalt((OSType) selector,(ProcPtr) gestaltFunction);
  31347. æC 
  31348. Use the NewGestalt function to add selector codes to those already recognized by
  31349. Gestalt.
  31350.  
  31351. Trap macro  _NewGestalt
  31352. On entry    A0: address of new selector function
  31353.             D0: selector code
  31354. On exit     D0: result code
  31355.  
  31356. NewGestalt takes as parameters the selector to be registered and the function
  31357. that Gestalt calls when it receives this selector. The interface for the
  31358. selectorFunction function is defined in “Specifying Gestalt Selector Functions”
  31359. earlier in this chapter.
  31360.  
  31361. Result codes
  31362. noErr                      0  No error
  31363. memFullErr              –108  Ran out of memory
  31364. gestaltDupSelectorErr  –5552  Selector already exists
  31365. gestaltLocationErr     –5553  Function not in system heap
  31366.  
  31367. æKY ReplaceGestalt
  31368. æFc GestaltEqu.h
  31369. æT Function
  31370. æD pascal OSErr ReplaceGestalt(OSType selector,ProcPtr gestaltFunction,ProcPtr *oldGestaltFunction); 
  31371. æDT OSErr myVariable = ReplaceGestalt((OSType) selector,(ProcPtr) gestaltFunction,(ProcPtr *) oldGestaltFunction);
  31372. æC 
  31373. The ReplaceGestalt function allows an application to replace the function that
  31374. is currently associated with a selector.
  31375.  
  31376. Trap macro  _ReplaceGestalt
  31377. On entry    A0: address of new selector function
  31378.             D0: selector code
  31379. On exit     A0: address of old selector function
  31380.             D0: result code
  31381.  
  31382. The interface for the selectorFunction function is defined in “Specifying
  31383. Gestalt Selector Functions” earlier in this chapter. The new function must
  31384. reside in the system heap and may want to call the function previously
  31385. associated with the named selector. It may do so by using the address returned
  31386. in the parameter oldGestaltFunction. If ReplaceGestalt returns an error of any
  31387. type, then the value of oldGestaltFunction is undefined.
  31388.  
  31389. Result codes
  31390. noErr                        0  No error
  31391. gestaltUndefSelectorErr  –5551  Undefined selector
  31392. gestaltLocationErr       –5553  Function not in system heap
  31393.  
  31394.  
  31395. æKY Globals
  31396. æKL ABusDCE
  31397. ABusVars
  31398. ACount
  31399. ADBBase
  31400. ANumber
  31401. ASCBase
  31402. AlarmState
  31403. ApFontID
  31404. AppParmHandle
  31405. ApplLimit
  31406. ApplScratch
  31407. ApplZone
  31408. BootDrive
  31409. BufPtr
  31410. BufTgDate
  31411. BufTgFBkNum
  31412. BufTgFFlg
  31413. BufTgFNum
  31414. BusErrVct
  31415. CPUFlag
  31416. CQDGlobals
  31417. CaretTime
  31418. ChunkyDepth
  31419. ColLines
  31420. CrsrAddr
  31421. CrsrBase
  31422. CrsrBusy
  31423. CrsrCouple
  31424. CrsrDevice
  31425. CrsrNew
  31426. CrsrObscure
  31427. CrsrPin
  31428. CrsrPtr
  31429. CrsrRect
  31430. CrsrRow
  31431. CrsrSave
  31432. CrsrScale
  31433. CrsrState
  31434. CrsrThresh
  31435. CrsrVis
  31436. CurActivate
  31437. CurApName
  31438. CurApRefNum
  31439. CurDeactive
  31440. CurDirStore
  31441. CurJTOffset
  31442. CurMap
  31443. CurPageOption
  31444. CurPitch
  31445. CurStackBase
  31446. CurrentA5
  31447. DABeeper
  31448. DAStrings
  31449. DSAlertRect
  31450. DSAlertTab
  31451. DSCtrAdj
  31452. DSDrawProc
  31453. DSErrCode
  31454. DSWndUpdate
  31455. DTQFlags
  31456. DTQueue
  31457. DTskQHdr
  31458. DTskQTail
  31459. DefVCBPtr
  31460. DefltStack
  31461. DeskHook
  31462. DeskPattern
  31463. DeviceList
  31464. DlgFont
  31465. DoubleTime
  31466. DragHook
  31467. DragPattern
  31468. DrvQHdr
  31469. DskErr
  31470. DskVerify
  31471. EjectNotify
  31472. EndSRTPtr
  31473. EventQueue
  31474. EvtBufCnt
  31475. ExpandMem
  31476. ExtStsDT
  31477. FCBSPtr
  31478. FSQHdr
  31479. FScaleDisable
  31480. FinderName
  31481. GZMoveHnd
  31482. GZRootHnd
  31483. GZRootPtr
  31484. GetParam
  31485. GhostWindow
  31486. GrayRgn
  31487. HeapEnd
  31488. HiHeapMark
  31489. HiKeyLast
  31490. HiliteMode
  31491. HiliteRGB
  31492. HpChk
  31493. IAZNotify
  31494. IWM
  31495. IconTLAddr
  31496. IntFlag
  31497. IntlSpec
  31498. JAllocCrsr
  31499. JCrsrTask
  31500. JDTInstall
  31501. JFetch
  31502. JGNEFilter
  31503. JIODone
  31504. JKybdTask
  31505. JOpcodeProc
  31506. JSetCCrsr
  31507. JStash
  31508. JSwapMMU
  31509. JVBLTask
  31510. JournalFlag
  31511. JournalRef
  31512. KbdLast
  31513. KbdType
  31514. KbdVars
  31515. Key1Trans
  31516. Key2Trans
  31517. KeyLast
  31518. KeyMVars
  31519. KeyMapLM
  31520. KeyRepThresh
  31521. KeyRepTime
  31522. KeyThresh
  31523. KeyTime
  31524. KeypadMap
  31525. LastTxGDevice
  31526. LaunchFlag
  31527. Lo3Bytes
  31528. LoadTrap
  31529. LoaderPBlock
  31530. Lvl1DT
  31531. Lvl2DT
  31532. MBState
  31533. MBTicks
  31534. MBarEnable
  31535. MBarHeight
  31536. MBarHook
  31537. MMDefFlags
  31538. MMU32bit
  31539. MMUFlags
  31540. MMUFluff
  31541. MMUTbl
  31542. MMUTblSize
  31543. MMUType
  31544. MTemp
  31545. MainDevice
  31546. MaskBC
  31547. MaskHandle
  31548. MaskPtr
  31549. MemErr
  31550. MemTop
  31551. MenuFlash
  31552. MenuHook
  31553. MenuList
  31554. MickeyBytes
  31555. MinStack
  31556. MinusOne
  31557. MmInOK
  31558. MonkeyLives
  31559. Mouse
  31560. MouseMask
  31561. MouseOffset
  31562. NMIFlag
  31563. NewCrsrJTbl
  31564. OldContent
  31565. OldStructure
  31566. OneOne
  31567. PCDeskPat
  31568. PWMBuf2
  31569. PaintWhite
  31570. PortAUse
  31571. PortBUse
  31572. PortList
  31573. PrintErr
  31574. QDColors
  31575. QDErrLM
  31576. QDExist
  31577. RAMBase
  31578. RGBBlack
  31579. RGBWhite
  31580. ROM85
  31581. ROMBase
  31582. ROMFont0
  31583. ROMMapHndl
  31584. RawMouse
  31585. ResErr
  31586. ResErrProc
  31587. ResLoad
  31588. ResReadOnly
  31589. RestProc
  31590. ResumeProc
  31591. RndSeed
  31592. RomMapInsert
  31593. RowBits
  31594. SCCASts
  31595. SCCBSts
  31596. SCCRd
  31597. SCCWr
  31598. SCSIBase
  31599. SCSIDMA
  31600. SCSIGlobals
  31601. SCSIHsk
  31602. SCSIPoll
  31603. SDMJmpTblPtr
  31604. SEVarBase
  31605. SEvtEnb
  31606. SFSaveDisk
  31607. SInfoPtr
  31608. SInitFlags
  31609. SMGlobals
  31610. SPATalkA
  31611. SPATalkB
  31612. SPAlarm
  31613. SPClikCaret
  31614. SPConfig
  31615. SPFont
  31616. SPKbd
  31617. SPMisc1
  31618. SPMisc2
  31619. SPPortA
  31620. SPPortB
  31621. SPPrint
  31622. SPValid
  31623. SPVolCtl
  31624. SRsrcTblPtr
  31625. SaveSegHandle
  31626. SaveUpdate
  31627. SaveVisRgn
  31628. ScrDmpEnb
  31629. ScrDmpType
  31630. ScrHRes
  31631. ScrVRes
  31632. ScrapCount
  31633. ScrapEnd
  31634. ScrapHandle
  31635. ScrapInfo
  31636. ScrapName
  31637. ScrapSize
  31638. ScrapState
  31639. ScrapTag
  31640. ScrapVars
  31641. Scratch20
  31642. Scratch8
  31643. ScreenBytes
  31644. ScreenRow
  31645. ScrnBase
  31646. ScrnVBLPtr
  31647. SdVolume
  31648. SdmBusErr
  31649. SegHiEnable
  31650. SerialVars
  31651. SlotPrTbl
  31652. SlotQDT
  31653. SlotTICKS
  31654. SlotVBLQ
  31655. SoundActive
  31656. SoundBase
  31657. SoundDCE
  31658. SoundLevel
  31659. SoundPtr
  31660. SoundVBL
  31661. SrcDevice
  31662. StkLowPt
  31663. SwitcherTPtr
  31664. SysEvtBuf
  31665. SysEvtMask
  31666. SysMap
  31667. SysMapHndl
  31668. SysParam
  31669. SysResName
  31670. SysVersion
  31671. SysZone
  31672. TEDoText
  31673. TERecal
  31674. TEScrpHandle
  31675. TEScrpLength
  31676. TESysJust
  31677. TEWdBreak
  31678. TableSeed
  31679. TagData
  31680. TheCrsr
  31681. TheGDevice
  31682. TheMenu
  31683. TheZone
  31684. Ticks
  31685. Time
  31686. TimeDBRA
  31687. TimeLM
  31688. TimeSCCDB
  31689. TimeSCSIDB
  31690. TmpResLoad
  31691. ToExtFS
  31692. ToolScratch
  31693. TopMapHndl
  31694. UTableBase
  31695. UnitNtryCnt
  31696. VBLQueue
  31697. VCBQHdr
  31698. VIA
  31699. VIA2DT
  31700. VertRRate
  31701. VidMode
  31702. VidType
  31703. VideoInfoOK
  31704. WMgrCPort
  31705. WMgrPort
  31706. WWExist
  31707. WarmStart
  31708. WindowList
  31709. WordRedraw
  31710.  
  31711. æKY ACount
  31712. æFc Globals
  31713. æD ACount  0xA9A [GLOBAL VAR] Stage number (0 through 3) of last alert (word)
  31714.  
  31715.  
  31716. æKY ANumber
  31717. æFc Globals
  31718. æD ANumber  0xA98 [GLOBAL VAR] Resource ID of last alert (word)
  31719.  
  31720.  
  31721. æKY ApFontID
  31722. æFc Globals
  31723. æD ApFontID 0x984 [GLOBAL VAR] Font number of application font (word)
  31724.  
  31725.  
  31726. æKY ApplScratch
  31727. æFc Globals
  31728. æD ApplScratch 0xA78 [GLOBAL VAR] 12-byte scratch area reserved for use by applications
  31729.  
  31730.  
  31731. æKY AppParmHandle
  31732. æFc Globals
  31733. æD AppParmHandle 0xAEC [GLOBAL VAR] Handle to Finder information
  31734.  
  31735.  
  31736. æKY DABeeper
  31737. æFc Globals
  31738. æD DABeeper 0xA9C [GLOBAL VAR] Address of current sound procedure
  31739.  
  31740.  
  31741. æKY DAStrings
  31742. æFc Globals
  31743. æD DAStrings 0xAA0 [GLOBAL VAR] Handles to ParamText strings (16 bytes) 
  31744.  
  31745.  
  31746. æKY DefVCBPtr
  31747. æFc Globals
  31748. æD DefVCBPtr 0x352 [GLOBAL VAR] Pointer to default volume control block 
  31749.  
  31750.  
  31751. æKY DlgFont
  31752. æFc Globals
  31753. æD DlgFont  0xAFA [GLOBAL VAR] Font number for dialogs and alerts (word)
  31754.  
  31755.  
  31756. æKY DragPattern
  31757. æFc Globals
  31758. æD DragPattern 0xA34 [GLOBAL VAR] Pattern of dragged region's outline (8 bytes)
  31759.  
  31760.  
  31761. æKY FCBSPtr
  31762. æFc Globals
  31763. æD FCBSPtr  0x34E [GLOBAL VAR] Pointer to file-control-block buffer
  31764.  
  31765.  
  31766. æKY FinderName
  31767. æFc Globals
  31768. æD FinderName 0x2E0 [GLOBAL VAR] Name of the Finder (length byte followed by up to 15 
  31769. characters)
  31770.  
  31771. æKY FScaleDisable
  31772. æFc Globals
  31773. æC FScaleDisable 0xA63 [GLOBAL VAR] Nonzero to disable font scaling (byte)
  31774.  
  31775.  
  31776. æKY FSQHdr
  31777. æFc Globals
  31778. æD FSQHdr  0x360 [GLOBAL VAR] File I/O queue header (10 bytes)
  31779.  
  31780.  
  31781. æKY MBarEnable
  31782. æFc Globals
  31783. æD MBarEnable 0xA20 [GLOBAL VAR] Unique menu ID for active desk accessory, when menu bar 
  31784.                  belongs to the accessory (word) 
  31785.  
  31786. æKY MBarHook
  31787. æFc Globals
  31788. æD MBarHook 0xA2C [GLOBAL VAR] Address of routine called by MenuSelect before menu is 
  31789.                drawn
  31790.  
  31791. æKY MenuFlash
  31792. æFc Globals
  31793. æD MenuFlash 0xA24 [GLOBAL VAR] Count for duration of menu item blinking (word)
  31794.  
  31795.  
  31796. æKY MenuHook
  31797. æFc Globals
  31798. æD MenuHook 0xA30 [GLOBAL VAR] Address of routine called during MenuSelect
  31799.  
  31800.  
  31801. æKY MenuList
  31802. æFc Globals
  31803. æD MenuList 0xA1C [GLOBAL VAR] Handle to current menu list
  31804.  
  31805.  
  31806. æKY OldContent
  31807. æFc Globals
  31808. æD OldContent 0x9EA [GLOBAL VAR] Handle to saved content region
  31809.  
  31810.  
  31811. æKY OldStructure
  31812. æFc Globals
  31813. æD OldStructure 0x9E6 [GLOBAL VAR] Handle to saved structure region
  31814.  
  31815.  
  31816. æKY PrintErr
  31817. æFc Globals
  31818. æD PrintErr 0x944 [GLOBAL VAR] Result code from last Printing Manager routine (word)
  31819.  
  31820.  
  31821. æKY ROMFont0
  31822. æFc Globals
  31823. æD ROMFont0 0x980 [GLOBAL VAR] Handle to font record for system font
  31824.  
  31825.  
  31826. æKY SaveUpdate
  31827. æFc Globals
  31828. æD SaveUpdate 0x9DA [GLOBAL VAR] Flag for whether to generate update events (word)
  31829.  
  31830.  
  31831. æKY SaveVisRgn
  31832. æFc Globals
  31833. æD SaveVisRgn 0x9F2 [GLOBAL VAR] Handle to saved visRgn
  31834.  
  31835.  
  31836. æKY TheMenu
  31837. æFc Globals
  31838. æD TheMenu  0xA26 [GLOBAL VAR] Menu ID of currently highlighted menu (word)
  31839.  
  31840.  
  31841. æKY ToExtFS
  31842. æFc Globals
  31843. æD ToExtFS  0x3F2 [GLOBAL VAR] Pointer to external file system
  31844.  
  31845.  
  31846. æKY ToolScratch
  31847. æFc Globals
  31848. æD ToolScratch 0x9CE [GLOBAL VAR] 8-byte scratch area
  31849.  
  31850.  
  31851. æKY VCBQHdr
  31852. æFc Globals
  31853. æD VCBQHdr  0x356 [GLOBAL VAR] Volume-control-block queue header (10 bytes)
  31854.  
  31855.  
  31856.  
  31857. æKY Graf3D.h
  31858. æKL Clip3D
  31859. GetPort3D
  31860. Identity
  31861. InitGrf3d
  31862. Line2D
  31863. Line3D
  31864. LineTo2D
  31865. LineTo3D
  31866. LookAt
  31867. Move2D
  31868. Move3D
  31869. MoveTo2D
  31870. MoveTo3D
  31871. Open3DPort
  31872. Pitch
  31873. Roll
  31874. Scale
  31875. SetPort3D
  31876. SetPt2D
  31877. SetPt3D
  31878. Skew
  31879. Transform
  31880. Translate
  31881. ViewAngle
  31882. ViewPort
  31883. Yaw
  31884.  
  31885. Point2D
  31886. Point3D
  31887. Port3D
  31888. Port3DHandle
  31889. Port3DPtr
  31890. radConst
  31891. XfMatrix
  31892.  
  31893. æKY radConst
  31894. æFc Graf3D.h
  31895. æT #define
  31896. æD #define radConst 3754936
  31897. æC 
  31898.  
  31899. æKY XfMatrix
  31900. æFc Graf3D.h
  31901. æT typedef
  31902. æD typedef Fixed XfMatrix[4][4];
  31903. æC 
  31904.  
  31905. æKY Point3D
  31906. æFc Graf3D.h
  31907. æT struct
  31908. æD struct Point3D {
  31909.     Fixed x;
  31910.     Fixed y;
  31911.     Fixed z;
  31912. };
  31913.  
  31914. typedef struct Point3D Point3D;
  31915. æC 
  31916.  
  31917. æKY Point2D
  31918. æFc Graf3D.h
  31919. æT struct
  31920. æD struct Point2D {
  31921.     Fixed x;
  31922.     Fixed y;
  31923. };
  31924.  
  31925. typedef struct Point2D Point2D;
  31926. æC 
  31927.  
  31928. æKY Port3D
  31929. Port3DPtr
  31930. Port3DHandle
  31931. æFc Graf3D.h
  31932. æT struct
  31933. æD struct Port3D {
  31934.     GrafPtr grPort;
  31935.     Rect viewRect;
  31936.     Fixed xLeft;
  31937.     Fixed yTop;
  31938.     Fixed xRight;
  31939.     Fixed yBottom;
  31940.     Point3D pen;
  31941.     Point3D penPrime;
  31942.     Point3D eye;
  31943.     Fixed hSize;
  31944.     Fixed vSize;
  31945.     Fixed hCenter;
  31946.     Fixed vCenter;
  31947.     Fixed xCotan;
  31948.     Fixed yCotan;
  31949.     char filler;
  31950.     char ident;
  31951.     XfMatrix xForm;
  31952. };
  31953.  
  31954. typedef struct Port3D Port3D;
  31955. typedef Port3D *Port3DPtr, **Port3DHandle;
  31956.  
  31957. æC 
  31958.  
  31959. æKY InitGrf3d
  31960. æFc Graf3D.h
  31961. æT Function
  31962. æD pascal void InitGrf3d(Port3DHandle port); 
  31963. æDT InitGrf3d((Port3DHandle) port);
  31964. æC 
  31965.  
  31966. æKY Open3DPort
  31967. æFc Graf3D.h
  31968. æT Function
  31969. æD pascal void Open3DPort(Port3DPtr port); 
  31970. æDT Open3DPort((Port3DPtr) port);
  31971. æC 
  31972.  
  31973. æKY SetPort3D
  31974. æFc Graf3D.h
  31975. æT Function
  31976. æD pascal void SetPort3D(Port3DPtr port); 
  31977. æDT SetPort3D((Port3DPtr) port);
  31978. æC     SetPort sets the grafPort indicated by gp to be the current port.
  31979. The global pointer thePort always points to the current port. All
  31980. QuickDraw drawing routines affect the bitMap thePort^.portBits and use
  31981. the local coordinate system of thePort^. Note that OpenPort and
  31982. InitPort do a SetPort to the given port.
  31983.  
  31984. Warning:
  31985.  
  31986.     Never do a SetPort to a port that has not been opened
  31987.     with OpenPort.
  31988.  
  31989.     Each port possesses its own pen and text characteristics which
  31990. remain unchanged when the port is not selected as the current port.
  31991.  
  31992. æKY GetPort3D
  31993. æFc Graf3D.h
  31994. æT Function
  31995. æD pascal void GetPort3D(Port3DPtr *port); 
  31996. æDT GetPort3D((Port3DPtr *) port);
  31997. æC     GetPort returns a pointer to the current grafPort. If you have a
  31998. program that draws into more than one grafPort, it's extremely useful 
  31999. to have each procedure save the current grafPort (with GetPort), set
  32000. its own grafPort, do drawing or calculations, and then restore the
  32001. previous grafPort (with SetPort). The pointer to the current grafPort
  32002. is also available through the global pointer thePort, but you may
  32003. prefer to use GetPort for better readability of your program text. For
  32004. example, a procedure could do a GetPort (savePort) before setting its
  32005. own grafPort and a SetPort (savePort) afterwards to restore the
  32006. previous port.
  32007.  
  32008. æKY MoveTo2D
  32009. æFc Graf3D.h
  32010. æT Function
  32011. æD pascal void MoveTo2D(Fixed x,Fixed y); 
  32012. æDT MoveTo2D((Fixed) x,(Fixed) y);
  32013. æC     MoveTo moves the pen to location  (h,v) in the local coordinates of
  32014. the current grafPort. No drawing is performed.
  32015.  
  32016. æKY MoveTo3D
  32017. æFc Graf3D.h
  32018. æT Function
  32019. æD pascal void MoveTo3D(Fixed x,Fixed y,Fixed z); 
  32020. æDT MoveTo3D((Fixed) x,(Fixed) y,(Fixed) z);
  32021. æC 
  32022.  
  32023. æKY LineTo2D
  32024. æFc Graf3D.h
  32025. æT Function
  32026. æD pascal void LineTo2D(Fixed x,Fixed y); 
  32027. æDT LineTo2D((Fixed) x,(Fixed) y);
  32028. æC     This procedure draws a line to the location that is a distance of dh
  32029. horizontally and dv vertically from the current pen location; it calls
  32030. LineTo(h+dh,v+dv), where (h,v) is the current location. The positive
  32031. directions are to the right and down. The pen location becomes the
  32032. coordinates of the end of the line after the line is drawn. See the
  32033. general discussion of drawing.
  32034.  
  32035.     If a region or polygon is open and being formed, its outline is
  32036. infinitely thin and is not affected by the pnSize, pnMode, or pnPat.
  32037. (See OpenRgn and OpenPoly.)
  32038.  
  32039. æKY Move2D
  32040. æFc Graf3D.h
  32041. æT Function
  32042. æD pascal void Move2D(Fixed dx,Fixed dy); 
  32043. æDT Move2D((Fixed) dx,(Fixed) dy);
  32044. æC 
  32045.  
  32046. æKY Move3D
  32047. æFc Graf3D.h
  32048. æT Function
  32049. æD pascal void Move3D(Fixed dx,Fixed dy,Fixed dz); 
  32050. æDT Move3D((Fixed) dx,(Fixed) dy,(Fixed) dz);
  32051. æC 
  32052.  
  32053. æKY Line2D
  32054. æFc Graf3D.h
  32055. æT Function
  32056. æD pascal void Line2D(Fixed dx,Fixed dy); 
  32057. æDT Line2D((Fixed) dx,(Fixed) dy);
  32058. æC 
  32059.  
  32060. æKY Line3D
  32061. æFc Graf3D.h
  32062. æT Function
  32063. æD pascal void Line3D(Fixed dx,Fixed dy,Fixed dz); 
  32064. æDT Line3D((Fixed) dx,(Fixed) dy,(Fixed) dz);
  32065. æC 
  32066.  
  32067. æKY ViewPort
  32068. æFc Graf3D.h
  32069. æT Function
  32070. æD pascal void ViewPort(const Rect *r); 
  32071. æDT ViewPort((const Rect *) r);
  32072. æC 
  32073.  
  32074. æKY LookAt
  32075. æFc Graf3D.h
  32076. æT Function
  32077. æD pascal void LookAt(Fixed left,Fixed top,Fixed right,Fixed bottom); 
  32078. æDT LookAt((Fixed) left,(Fixed) top,(Fixed) right,(Fixed) bottom);
  32079. æC 
  32080.  
  32081. æKY ViewAngle
  32082. æFc Graf3D.h
  32083. æT Function
  32084. æD pascal void ViewAngle(Fixed angle); 
  32085. æDT ViewAngle((Fixed) angle);
  32086. æC 
  32087.  
  32088. æKY Identity
  32089. æFc Graf3D.h
  32090. æT Function
  32091. æD pascal void Identity(void); 
  32092. æDT Identity()(void);
  32093. æC 
  32094.  
  32095. æKY Scale
  32096. æFc Graf3D.h
  32097. æT Function
  32098. æD pascal void Scale(Fixed xFactor,Fixed yFactor,Fixed zFactor); 
  32099. æDT Scale((Fixed) xFactor,(Fixed) yFactor,(Fixed) zFactor);
  32100. æC 
  32101.  
  32102. æKY Translate
  32103. æFc Graf3D.h
  32104. æT Function
  32105. æD pascal void Translate(Fixed dx,Fixed dy,Fixed dz); 
  32106. æDT Translate((Fixed) dx,(Fixed) dy,(Fixed) dz);
  32107. æC 
  32108.  
  32109. æKY Pitch
  32110. æFc Graf3D.h
  32111. æT Function
  32112. æD pascal void Pitch(Fixed xAngle); 
  32113. æDT Pitch((Fixed) xAngle);
  32114. æC 
  32115.  
  32116. æKY Yaw
  32117. æFc Graf3D.h
  32118. æT Function
  32119. æD pascal void Yaw(Fixed yAngle); 
  32120. æDT Yaw((Fixed) yAngle);
  32121. æC 
  32122.  
  32123. æKY Roll
  32124. æFc Graf3D.h
  32125. æT Function
  32126. æD pascal void Roll(Fixed zAngle); 
  32127. æDT Roll((Fixed) zAngle);
  32128. æC 
  32129.  
  32130. æKY Skew
  32131. æFc Graf3D.h
  32132. æT Function
  32133. æD pascal void Skew(Fixed zAngle); 
  32134. æDT Skew((Fixed) zAngle);
  32135. æC 
  32136.  
  32137. æKY Transform
  32138. æFc Graf3D.h
  32139. æT Function
  32140. æD pascal void Transform(const Point3D *src,Point3D *dst); 
  32141. æDT Transform((const Point3D *) src,(Point3D *) dst);
  32142. æC 
  32143.  
  32144. æKY Clip3D
  32145. æFc Graf3D.h
  32146. æT Function
  32147. æD pascal short Clip3D(const Point3D *src1,const Point3D *src2,Point *dst1,
  32148.     Point *dst2); 
  32149. æDT short myVariable = Clip3D((const Point3D *) src1,(const Point3D *) src2,(Point *) dst1,(
  32150.     Point) * dst2);
  32151. æC 
  32152.  
  32153. æKY SetPt3D
  32154. æFc Graf3D.h
  32155. æT Function
  32156. æD pascal void SetPt3D(Point3D *pt3D,Fixed x,Fixed y,Fixed z); 
  32157. æDT SetPt3D((Point3D *) pt3D,(Fixed) x,(Fixed) y,(Fixed) z);
  32158. æC     SetPt assigns two integer coordinates to a variable of type Point.
  32159.  
  32160. æKY SetPt2D
  32161. æFc Graf3D.h
  32162. æT Function
  32163. æD pascal void SetPt2D(Point2D *pt2D,Fixed x,Fixed y); 
  32164. æDT SetPt2D((Point2D *) pt2D,(Fixed) x,(Fixed) y);
  32165. æC 
  32166.  
  32167. æKY LineTo3D
  32168. æFc Graf3D.h
  32169. æT Function
  32170. æD pascal void LineTo3D(Fixed x,Fixed y,Fixed z); 
  32171. æDT LineTo3D((Fixed) x,(Fixed) y,(Fixed) z);
  32172. æC 
  32173.  
  32174.  
  32175. æKY HyperXCmd.h
  32176. æKL BoolToStr
  32177. EvalExpr
  32178. ExtToStr
  32179. GetFieldByID
  32180. GetFieldByName
  32181. GetFieldByNum
  32182. GetGlobal
  32183. LongToStr
  32184. NumToHex
  32185. NumToStr
  32186. PasToZero
  32187. ReturnToPas
  32188. ScanToReturn
  32189. ScanToZero
  32190. SendCardMessage
  32191. SendHCMessage
  32192. SetFieldByID
  32193. SetFieldByName
  32194. SetFieldByNum
  32195. SetGlobal
  32196. StringEqual
  32197. StringLength
  32198. StringMatch
  32199. StrToBool
  32200. StrToExt
  32201. StrToLong
  32202. StrToNum
  32203. ZeroBytes
  32204. ZeroToPas
  32205.  
  32206. XCmdBlock
  32207. XCmdPtr
  32208. xreqBoolToStr
  32209. xreqEvalExpr
  32210. xreqExtToStr
  32211. xreqGetFieldByID
  32212. xreqGetFieldByName
  32213. xreqGetFieldByNum
  32214. xreqGetGlobal
  32215. xreqLongToStr
  32216. xreqNumToHex
  32217. xreqNumToStr
  32218. xreqPasToZero
  32219. xreqReturnToPas
  32220. xreqScanToReturn
  32221. xreqScanToZero
  32222. xreqSendCardMessage
  32223. xreqSendHCMessage
  32224. xreqSetFieldByID
  32225. xreqSetFieldByName
  32226. xreqSetFieldByNum
  32227. xreqSetGlobal
  32228. xreqStringEqual
  32229. xreqStringLength
  32230. xreqStringMatch
  32231. xreqStrToBool
  32232. xreqStrToExt
  32233. xreqStrToLong
  32234. xreqStrToNum
  32235. xreqZeroBytes
  32236. xreqZeroToPas
  32237. xresFail
  32238. xresNotImp
  32239. xresSucc
  32240.  
  32241. æKY xresSucc
  32242. æFc HyperXCmd.h
  32243. æT #define
  32244. æD 
  32245. /* result codes */
  32246.  
  32247. #define xresSucc 0
  32248. æC 
  32249.  
  32250. æKY xresFail
  32251. æFc HyperXCmd.h
  32252. æT #define
  32253. æD #define xresFail 1
  32254. æC 
  32255.  
  32256. æKY xresNotImp
  32257. æFc HyperXCmd.h
  32258. æT #define
  32259. æD #define xresNotImp 2
  32260. æC 
  32261.  
  32262. æKY xreqSendCardMessage
  32263. æFc HyperXCmd.h
  32264. æT #define
  32265. æD 
  32266. /* request codes */
  32267.  
  32268. #define xreqSendCardMessage 1
  32269. æC 
  32270.  
  32271. æKY xreqEvalExpr
  32272. æFc HyperXCmd.h
  32273. æT #define
  32274. æD #define xreqEvalExpr 2
  32275. æC 
  32276.  
  32277. æKY xreqStringLength
  32278. æFc HyperXCmd.h
  32279. æT #define
  32280. æD #define xreqStringLength 3
  32281. æC 
  32282.  
  32283. æKY xreqStringMatch
  32284. æFc HyperXCmd.h
  32285. æT #define
  32286. æD #define xreqStringMatch 4
  32287. æC 
  32288.  
  32289. æKY xreqSendHCMessage
  32290. æFc HyperXCmd.h
  32291. æT #define
  32292. æD #define xreqSendHCMessage 5
  32293. æC 
  32294.  
  32295. æKY xreqZeroBytes
  32296. æFc HyperXCmd.h
  32297. æT #define
  32298. æD #define xreqZeroBytes 6
  32299. æC 
  32300.  
  32301. æKY xreqPasToZero
  32302. æFc HyperXCmd.h
  32303. æT #define
  32304. æD #define xreqPasToZero 7
  32305. æC 
  32306.  
  32307. æKY xreqZeroToPas
  32308. æFc HyperXCmd.h
  32309. æT #define
  32310. æD #define xreqZeroToPas 8
  32311. æC 
  32312.  
  32313. æKY xreqStrToLong
  32314. æFc HyperXCmd.h
  32315. æT #define
  32316. æD #define xreqStrToLong 9
  32317. æC 
  32318.  
  32319. æKY xreqStrToNum
  32320. æFc HyperXCmd.h
  32321. æT #define
  32322. æD #define xreqStrToNum 10
  32323. æC 
  32324.  
  32325. æKY xreqStrToBool
  32326. æFc HyperXCmd.h
  32327. æT #define
  32328. æD #define xreqStrToBool 11
  32329. æC 
  32330.  
  32331. æKY xreqStrToExt
  32332. æFc HyperXCmd.h
  32333. æT #define
  32334. æD #define xreqStrToExt 12
  32335. æC 
  32336.  
  32337. æKY xreqLongToStr
  32338. æFc HyperXCmd.h
  32339. æT #define
  32340. æD #define xreqLongToStr 13
  32341. æC 
  32342.  
  32343. æKY xreqNumToStr
  32344. æFc HyperXCmd.h
  32345. æT #define
  32346. æD #define xreqNumToStr 14
  32347. æC 
  32348.  
  32349. æKY xreqNumToHex
  32350. æFc HyperXCmd.h
  32351. æT #define
  32352. æD #define xreqNumToHex 15
  32353. æC 
  32354.  
  32355. æKY xreqBoolToStr
  32356. æFc HyperXCmd.h
  32357. æT #define
  32358. æD #define xreqBoolToStr 16
  32359. æC 
  32360.  
  32361. æKY xreqExtToStr
  32362. æFc HyperXCmd.h
  32363. æT #define
  32364. æD #define xreqExtToStr 17
  32365. æC 
  32366.  
  32367. æKY xreqGetGlobal
  32368. æFc HyperXCmd.h
  32369. æT #define
  32370. æD #define xreqGetGlobal 18
  32371. æC 
  32372.  
  32373. æKY xreqSetGlobal
  32374. æFc HyperXCmd.h
  32375. æT #define
  32376. æD #define xreqSetGlobal 19
  32377. æC 
  32378.  
  32379. æKY xreqGetFieldByName
  32380. æFc HyperXCmd.h
  32381. æT #define
  32382. æD #define xreqGetFieldByName 20
  32383. æC 
  32384.  
  32385. æKY xreqGetFieldByNum
  32386. æFc HyperXCmd.h
  32387. æT #define
  32388. æD #define xreqGetFieldByNum 21
  32389. æC 
  32390.  
  32391. æKY xreqGetFieldByID
  32392. æFc HyperXCmd.h
  32393. æT #define
  32394. æD #define xreqGetFieldByID 22
  32395. æC 
  32396.  
  32397. æKY xreqSetFieldByName
  32398. æFc HyperXCmd.h
  32399. æT #define
  32400. æD #define xreqSetFieldByName 23
  32401. æC 
  32402.  
  32403. æKY xreqSetFieldByNum
  32404. æFc HyperXCmd.h
  32405. æT #define
  32406. æD #define xreqSetFieldByNum 24
  32407. æC 
  32408.  
  32409. æKY xreqSetFieldByID
  32410. æFc HyperXCmd.h
  32411. æT #define
  32412. æD #define xreqSetFieldByID 25
  32413. æC 
  32414.  
  32415. æKY xreqStringEqual
  32416. æFc HyperXCmd.h
  32417. æT #define
  32418. æD #define xreqStringEqual 26
  32419. æC 
  32420.  
  32421. æKY xreqReturnToPas
  32422. æFc HyperXCmd.h
  32423. æT #define
  32424. æD #define xreqReturnToPas 27
  32425. æC 
  32426.  
  32427. æKY xreqScanToReturn
  32428. æFc HyperXCmd.h
  32429. æT #define
  32430. æD #define xreqScanToReturn 28
  32431. æC 
  32432.  
  32433. æKY xreqScanToZero
  32434. æFc HyperXCmd.h
  32435. æT #define
  32436. æD #define xreqScanToZero 39 /* Yes, really 39!*/
  32437. æC 
  32438.  
  32439. æKY XCmdBlock
  32440. XCmdPtr
  32441. æFc HyperXCmd.h
  32442. æT struct
  32443. æD struct XCmdBlock {
  32444.     short paramCount;
  32445.     Handle params[16];
  32446.     Handle returnValue;
  32447.     Boolean passFlag;
  32448.     void (*entryPoint)(); /*to call back to HyperCard*/
  32449.     short request;
  32450.     short result;
  32451.     long inArgs[8];
  32452.     long outArgs[4];
  32453. };
  32454.  
  32455. typedef struct XCmdBlock XCmdBlock;
  32456. typedef XCmdBlock *XCmdPtr;
  32457.  
  32458. æC 
  32459.  
  32460. æKY SendCardMessage
  32461. æFc HyperXCmd.h
  32462. æT Function
  32463. æD pascal void SendCardMessage(XCmdPtr paramPtr,const Str255 msg); 
  32464. æDT SendCardMessage((XCmdPtr) paramPtr,(const Str255) msg);
  32465. æC 
  32466.  
  32467. æKY SendHCMessage
  32468. æFc HyperXCmd.h
  32469. æT Function
  32470. æD pascal void SendHCMessage(XCmdPtr paramPtr,const Str255 msg); 
  32471. æDT SendHCMessage((XCmdPtr) paramPtr,(const Str255) msg);
  32472. æC 
  32473.  
  32474. æKY GetGlobal
  32475. æFc HyperXCmd.h
  32476. æT Function
  32477. æD pascal Handle GetGlobal(XCmdPtr paramPtr,const Str255 globName); 
  32478. æDT Handle myVariable = GetGlobal((XCmdPtr) paramPtr,(const Str255) globName);
  32479. æC 
  32480.  
  32481. æKY SetGlobal
  32482. æFc HyperXCmd.h
  32483. æT Function
  32484. æD pascal void SetGlobal(XCmdPtr paramPtr,const Str255 globName,Handle globValue); 
  32485. æDT SetGlobal((XCmdPtr) paramPtr,(const Str255) globName,(Handle) globValue);
  32486. æC 
  32487.  
  32488. æKY GetFieldByID
  32489. æFc HyperXCmd.h
  32490. æT Function
  32491. æD pascal Handle GetFieldByID(XCmdPtr paramPtr,Boolean cardFieldFlag,short fieldID); 
  32492. æDT Handle myVariable = GetFieldByID((XCmdPtr) paramPtr,(Boolean) cardFieldFlag,(short) fieldID);
  32493. æC 
  32494.  
  32495. æKY GetFieldByName
  32496. æFc HyperXCmd.h
  32497. æT Function
  32498. æD pascal Handle GetFieldByName(XCmdPtr paramPtr,Boolean cardFieldFlag,const Str255 fieldName); 
  32499. æDT Handle myVariable = GetFieldByName((XCmdPtr) paramPtr,(Boolean) cardFieldFlag,(const Str255) fieldName);
  32500. æC 
  32501.  
  32502. æKY GetFieldByNum
  32503. æFc HyperXCmd.h
  32504. æT Function
  32505. æD pascal Handle GetFieldByNum(XCmdPtr paramPtr,Boolean cardFieldFlag,short fieldNum); 
  32506. æDT Handle myVariable = GetFieldByNum((XCmdPtr) paramPtr,(Boolean) cardFieldFlag,(short) fieldNum);
  32507. æC 
  32508.  
  32509. æKY SetFieldByID
  32510. æFc HyperXCmd.h
  32511. æT Function
  32512. æD pascal void SetFieldByID(XCmdPtr paramPtr,Boolean cardFieldFlag,short fieldID,
  32513.     Handle fieldVal); 
  32514. æDT SetFieldByID((XCmdPtr) paramPtr,(Boolean) cardFieldFlag,(short) fieldID,()
  32515.     Handle fieldVal);
  32516. æC 
  32517.  
  32518. æKY SetFieldByName
  32519. æFc HyperXCmd.h
  32520. æT Function
  32521. æD pascal void SetFieldByName(XCmdPtr paramPtr,Boolean cardFieldFlag,const Str255 fieldName,
  32522.     Handle fieldVal); 
  32523. æDT SetFieldByName((XCmdPtr) paramPtr,(Boolean) cardFieldFlag,(const Str255) fieldName,()
  32524.     Handle fieldVal);
  32525. æC 
  32526.  
  32527. æKY SetFieldByNum
  32528. æFc HyperXCmd.h
  32529. æT Function
  32530. æD pascal void SetFieldByNum(XCmdPtr paramPtr,Boolean cardFieldFlag,short fieldNum,
  32531.     Handle fieldVal); 
  32532. æDT SetFieldByNum((XCmdPtr) paramPtr,(Boolean) cardFieldFlag,(short) fieldNum,()
  32533.     Handle fieldVal);
  32534. æC 
  32535.  
  32536. æKY BoolToStr
  32537. æFc HyperXCmd.h
  32538. æT Function
  32539. æD pascal void BoolToStr(XCmdPtr paramPtr,Boolean bool,Str255 str); 
  32540. æDT BoolToStr((XCmdPtr) paramPtr,(Boolean) bool,(Str255) str);
  32541. æC 
  32542.  
  32543. æKY ExtToStr
  32544. æFc HyperXCmd.h
  32545. æT Function
  32546. æD pascal void ExtToStr(XCmdPtr paramPtr,extended *num,Str255 str); 
  32547. æDT ExtToStr((XCmdPtr) paramPtr,(extended *) num,(Str255) str);
  32548. æC 
  32549.  
  32550. æKY LongToStr
  32551. æFc HyperXCmd.h
  32552. æT Function
  32553. æD pascal void LongToStr(XCmdPtr paramPtr,long posNum,Str255 str); 
  32554. æDT LongToStr((XCmdPtr) paramPtr,(long) posNum,(Str255) str);
  32555. æC 
  32556.  
  32557. æKY NumToStr
  32558. æFc HyperXCmd.h
  32559. æT Function
  32560. æD pascal void NumToStr(XCmdPtr paramPtr,long num,Str255 str); 
  32561. æDT NumToStr((XCmdPtr) paramPtr,(long) num,(Str255) str);
  32562. æC 
  32563.  
  32564. æKY NumToHex
  32565. æFc HyperXCmd.h
  32566. æT Function
  32567. æD pascal void NumToHex(XCmdPtr paramPtr,long num,short nDigits,Str255 str); 
  32568. æDT NumToHex((XCmdPtr) paramPtr,(long) num,(short) nDigits,(Str255) str);
  32569. æC 
  32570.  
  32571. æKY StrToBool
  32572. æFc HyperXCmd.h
  32573. æT Function
  32574. æD pascal Boolean StrToBool(XCmdPtr paramPtr,const Str255 str); 
  32575. æDT Boolean myVariable = StrToBool((XCmdPtr) paramPtr,(const Str255) str);
  32576. æC 
  32577.  
  32578. æKY StrToExt
  32579. æFc HyperXCmd.h
  32580. æT Function
  32581. æD pascal extended StrToExt(XCmdPtr paramPtr,const Str255 str); 
  32582. æDT extended myVariable = StrToExt((XCmdPtr) paramPtr,(const Str255) str);
  32583. æC 
  32584.  
  32585. æKY StrToLong
  32586. æFc HyperXCmd.h
  32587. æT Function
  32588. æD pascal long StrToLong(XCmdPtr paramPtr,const Str255 str); 
  32589. æDT long myVariable = StrToLong((XCmdPtr) paramPtr,(const Str255) str);
  32590. æC 
  32591.  
  32592. æKY StrToNum
  32593. æFc HyperXCmd.h
  32594. æT Function
  32595. æD pascal long StrToNum(XCmdPtr paramPtr,const Str255 str); 
  32596. æDT long myVariable = StrToNum((XCmdPtr) paramPtr,(const Str255) str);
  32597. æC 
  32598.  
  32599. æKY PasToZero
  32600. æFc HyperXCmd.h
  32601. æT Function
  32602. æD pascal Handle PasToZero(XCmdPtr paramPtr,const Str255 str); 
  32603. æDT Handle myVariable = PasToZero((XCmdPtr) paramPtr,(const Str255) str);
  32604. æC 
  32605.  
  32606. æKY ZeroToPas
  32607. æFc HyperXCmd.h
  32608. æT Function
  32609. æD pascal void ZeroToPas(XCmdPtr paramPtr,char *zeroStr,Str255 pasStr); 
  32610. æDT ZeroToPas((XCmdPtr) paramPtr,(char *) zeroStr,(Str255) pasStr);
  32611. æC 
  32612.  
  32613. æKY EvalExpr
  32614. æFc HyperXCmd.h
  32615. æT Function
  32616. æD pascal Handle EvalExpr(XCmdPtr paramPtr,const Str255 expr); 
  32617. æDT Handle myVariable = EvalExpr((XCmdPtr) paramPtr,(const Str255) expr);
  32618. æC 
  32619.  
  32620. æKY ReturnToPas
  32621. æFc HyperXCmd.h
  32622. æT Function
  32623. æD pascal void ReturnToPas(XCmdPtr paramPtr,Ptr zeroStr,Str255 pasStr); 
  32624. æDT ReturnToPas((XCmdPtr) paramPtr,(Ptr) zeroStr,(Str255) pasStr);
  32625. æC 
  32626.  
  32627. æKY ScanToReturn
  32628. æFc HyperXCmd.h
  32629. æT Function
  32630. æD pascal void ScanToReturn(XCmdPtr paramPtr,Ptr *scanPtr); 
  32631. æDT ScanToReturn((XCmdPtr) paramPtr,(Ptr *) scanPtr);
  32632. æC 
  32633.  
  32634. æKY ScanToZero
  32635. æFc HyperXCmd.h
  32636. æT Function
  32637. æD pascal void ScanToZero(XCmdPtr paramPtr,Ptr *scanPtr); 
  32638. æDT ScanToZero((XCmdPtr) paramPtr,(Ptr *) scanPtr);
  32639. æC 
  32640.  
  32641. æKY StringEqual
  32642. æFc HyperXCmd.h
  32643. æT Function
  32644. æD pascal Boolean StringEqual(XCmdPtr paramPtr,const Str255 str1,const Str255 str2); 
  32645. æDT Boolean myVariable = StringEqual((XCmdPtr) paramPtr,(const Str255) str1,(const Str255) str2);
  32646. æC 
  32647.  
  32648. æKY StringMatch
  32649. æFc HyperXCmd.h
  32650. æT Function
  32651. æD pascal Ptr StringMatch(XCmdPtr paramPtr,const Str255 pattern,Ptr target); 
  32652. æDT Ptr myVariable = StringMatch((XCmdPtr) paramPtr,(const Str255) pattern,(Ptr) target);
  32653. æC 
  32654.  
  32655. æKY StringLength
  32656. æFc HyperXCmd.h
  32657. æT Function
  32658. æD pascal long StringLength(XCmdPtr paramPtr,char *strPtr); 
  32659. æDT long myVariable = StringLength((XCmdPtr) paramPtr,(char *) strPtr);
  32660. æC 
  32661.  
  32662. æKY ZeroBytes
  32663. æFc HyperXCmd.h
  32664. æT Function
  32665. æD pascal void ZeroBytes(XCmdPtr paramPtr,Ptr dstPtr,long longCount); 
  32666. æDT ZeroBytes((XCmdPtr) paramPtr,(Ptr) dstPtr,(long) longCount);
  32667. æC 
  32668.  
  32669.  
  32670. æKY IOCtl.h
  32671. ioctl
  32672. æFc IOCtl.h
  32673. æC 
  32674. ioctl    
  32675.  
  32676. FIOBUFSIZE    FIOINTERACTIVE    FIOSETEOF    TIOSPORT
  32677. FIODUPFD      FIOLSEEK          TIOFLUSH      
  32678. FIOFNAME      FIOREFNUM         TIOGPORT    
  32679.  
  32680.                           Synopsis
  32681.  
  32682. #include <IOCtl.h>
  32683. int ioctl(int fildes, unsigned int cmd, long *arg);
  32684.  
  32685.  
  32686.                            Description
  32687.  
  32688. The ioctl; function communicates with a file’s device driver by sending
  32689. control information, requesting status information, or both. 
  32690. Parameter cmd indicates which device-specific operations ioctl must perform.
  32691. Here are the control values.
  32692. Value of cmd     Description
  32693.  
  32694. FIOINTERACTIVE   The ioctl function returns 0 if the device is interactive; 
  32695.                  if not, it returns –1 and errno is set to EINVAL. 
  32696.                  Parameter arg is ignored.
  32697. FIOBUFSIZE   The ioctl function returns, in bytes, the optimal buffer size
  32698.              for this device; the buffer size is returned in a long pointed 
  32699.              to by arg. If the device has no default buffer size, ioctl 
  32700.              returns –1 and errno is set to EINVAL.
  32701. FIOFNAME     The ioctl function stores the filename associated with fildes 
  32702.              in a C string pointed to by arg. It returns –1 if the filename 
  32703.              exceeds 255 characters [E2BIG]. Use only for a program running 
  32704.              as an MPW tool.
  32705. FIOREFNUM    The ioctl function returns the Macintosh file reference number 
  32706.              associated with fildes; the reference number is returned in the 
  32707.              short pointed to by arg. If the fildes is not open on a Macintosh 
  32708.              file (such as the console device), ioctl returns –1.
  32709. FIOSETEOF    The ioctl function sets the logical end-of-file specified in the 
  32710.              long parameter arg. The value of arg is the new size of the file, 
  32711.              in bytes. This command can be used to reduce or increase the size 
  32712.              of the open file. The current file pointer is not affected unless 
  32713.              the file size is set below it.
  32714. TIOFLUSH     Used only for the console device and other terminal devices. 
  32715.              The ioctlfunction returns –1 if fildes is not a terminal device. 
  32716.              TIOFLUSH tells the device driver to throw away unread terminal 
  32717.              input. Parameter arg is ignored.
  32718.  
  32719.                           Diagnostics
  32720.  
  32721. If an error has occurred, a value of –1 is returned and errno is set to  
  32722. indicate the error.
  32723.  
  32724.                            Note
  32725.  
  32726. For cmd values FIOINTERACTIVE and FIOBUFSIZE, a function return of –1 is  
  32727. a meaningful response, not an error. For FIOINTERACTIVE, errno is set to  
  32728. EINVAL for devices that are not interactive. For FIOBUFSIZE, errno is set  
  32729. to EINVAL for devices that have no default buffering.
  32730. The cmd values FIOLSEEK and FIODUPFD are reserved for operating-system use.
  32731. If you set the console GrafPort with TIOSPORT, do not deallocate the storage  
  32732. for that port; the console device is written to by the exit function as your  
  32733. application terminates.
  32734.  
  32735. The console device ioctl control values TIOGPORT and TIOSPORT are no longer  
  32736. supported. It is no longer possible to perform direct I/O to a user-supplied  
  32737. GrafPort.
  32738.  
  32739.                            Warning
  32740.  
  32741. FIOREFNUM lets you do Macintosh I/O operations, such as Allocate, that are  
  32742. not available through ioctl. Do not close or modify the file pointer by using  
  32743. the reference number.
  32744.  
  32745. See also
  32746. fcntl, faccess, ferror
  32747.  
  32748. æKY FIOBUFSIZE
  32749. æFc IOCtl.h
  32750. æD #define FIOBUFSIZE   (('f'<<8)|03) /*Return optimal buffer size*/
  32751.  
  32752.  
  32753. æKY FIODUPFD
  32754. æFc IOCtl.h
  32755. æD #define FIODUPFD (('f'<<8)|01) /*3rd arg is min new fd number*/
  32756.  
  32757.  
  32758. æKY FIOFNAME
  32759. æFc IOCtl.h
  32760. æD #define FIOFNAME (('f'<<8)|04) /*Return filename*/
  32761.  
  32762.  
  32763. æKY FIOINTERACTIVE
  32764. æFc IOCtl.h
  32765. æD #define FIOINTERACTIVE   (('f'<<8)|02) /*If device is interactive*/
  32766.  
  32767.  
  32768. æKY FIOLSEEK
  32769. æFc IOCtl.h
  32770. æD #define FIOLSEEK (('f'<<8)|00) /*3rd arg is a _SeekType (below)*/
  32771.  
  32772.  
  32773. æKY FIOREFNUM
  32774. æFc IOCtl.h
  32775. æD #define FIOREFNUM    (('f'<<8)|05) /*Return fs refnum*/
  32776.  
  32777.  
  32778. æKY FIOSETEOF
  32779. æFc IOCtl.h
  32780. æD #define FIOSETEOF    (('f'<<8)|06) /*Set file length*/
  32781.  
  32782.  
  32783. æKY TIOFLUSH
  32784. æFc IOCtl.h
  32785. æD #define TIOFLUSH (('t'<<8)|00)
  32786.  
  32787.  
  32788. æKY TIOGPORT
  32789. æFc IOCtl.h
  32790. æD #define TIOGPORT (('t'<<8)|02)
  32791.  
  32792.  
  32793. æKY TIOSPORT
  32794. æFc IOCtl.h
  32795. æD #define TIOSPORT (('t'<<8)|01)
  32796.  
  32797.  
  32798.  
  32799. æKY ioctlæ
  32800. æDT 
  32801. int myVariable = ioctl((int) fildes, (unsigned int) cmd, (long *)arg);
  32802.  
  32803. æKY Limits.h
  32804. æFc Limits.h
  32805. æD                            Synopsis
  32806.  
  32807. #define CHAR_BIT     8
  32808. #define MB_LEN_MAX   2
  32809. #define CHAR_MI      (-128)
  32810. #define CHAR_MAX     127
  32811. #define SCHAR_MI     (-128)
  32812. #define SCHAR_MAX    127
  32813. #define UCHAR_MAX    255U
  32814. #define SHRT_MI      (-32768)
  32815. #define SHRT_MAX     32767
  32816. #define USHRT_MAX    65535U
  32817. #define INT_MI       (-2147483648)
  32818. #define INT_MAX      2147483647
  32819. #define UINT_MAX     4294967295U
  32820. #define LONG_MI      (-2147483648)
  32821. #define LONG_MAX     2147483647
  32822. #define ULONG_MAX    4294967295U
  32823.  
  32824. æC
  32825.                                 Description
  32826.  
  32827. The header <Limits.h> specifies the number of bits in a byte, 
  32828. and the minimum and maximum values for the integral types 
  32829. (that is, char, signed char, unsigned char, short, unsigned short, 
  32830. int, unsigned int, long, and unsigned l